Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P PyAV
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 37
    • Issues 37
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 26
    • Merge requests 26
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PyAV
  • PyAV
  • Issues
  • #341
Closed
Open
Issue created Jul 02, 2018 by Administrator@rootContributor

Cython 0.28, enums.pyx "OverflowError: Python int too large to convert to C long"

Created by: tshirtman

I could pip install pyav on linux arm with cython 0.28, but when i try to import it i get:

>>> import av
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/tangible/.local/lib/python2.7/site-packages/av/__init__.py", line 15, in <module>
    from av.audio.fifo import AudioFifo
  File "/home/tangible/.local/lib/python2.7/site-packages/av/audio/__init__.py", line 1, in <module>
    from .frame import AudioFrame
  File "av/audio/frame.pyx", line 1, in init av.audio.frame
  File "av/codec/codec.pxd", line 6, in init av.frame
  File "/home/tangible/.local/lib/python2.7/site-packages/av/codec/__init__.py", line 1, in <module>
    from .codec import Codec, codecs_available, codec_descriptor
  File "av/descriptor.pxd", line 4, in init av.codec.codec
  File "av/option.pxd", line 4, in init av.descriptor
  File "av/option.pyx", line 18, in init av.option
  File "av/enums.pyx", line 225, in av.enums.define_enum
  File "av/enums.pyx", line 28, in av.enums.EnumType._init
  File "av/enums.pyx", line 32, in av.enums.EnumType._create
  File "av/enums.pyx", line 145, in av.enums.EnumItem.__cinit__
OverflowError: Python int too large to convert to C long

i can see that it's from this bit of code.

        # Establish a hash that doesn't collide with anything that would return
        # true from __eq__.
        hash_ = id(self)
        name_hash = hash(name)
        value_hash = hash(value)
        while hash_ == name_hash or hash_ == value_hash:
            hash_ += 1
        self._hash = hash_

the last one being 145.

If i change _hash declaration to.

cdef unsigned long _hash

Then i can import it correctly.

Doing a PR.

Assignee
Assign to
Time tracking