Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with Cython 3.0a3 #1599

Closed
jamadden opened this issue May 1, 2020 · 4 comments · Fixed by #1603
Closed

Incompatible with Cython 3.0a3 #1599

jamadden opened this issue May 1, 2020 · 4 comments · Fixed by #1603

Comments

@jamadden
Copy link
Member

jamadden commented May 1, 2020

Building with Cython 3.0a3 started producing these errors and warnings; Cython 3.0a1 was fine:

[1/1] Cythonizing src/gevent/libev/corecext.pyx
warning: src/gevent/libev/corecext.pyx:1288:0: Global name __SYSERR_CALLBACK matched from within class scope in contradiction to to Python 'class private name' rules. This may change in a future release.
warning: src/gevent/libev/corecext.pyx:1288:0: Global name __SYSERR_CALLBACK matched from within class scope in contradiction to to Python 'class private name' rules. This may change in a future release.
warning: src/gevent/libev/corecext.pyx:1288:0: Global name __SYSERR_CALLBACK matched from within class scope in contradiction to to Python 'class private name' rules. This may change in a future release.
warning: src/gevent/libev/corecext.pyx:1288:0: Global name __SYSERR_CALLBACK matched from within class scope in contradiction to to Python 'class private name' rules. This may change in a future release.

Error compiling Cython file:
------------------------------------------------------------
...
        if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE):
            raise ValueError('illegal event mask: %r' % events)
        # All the vfd_functions are no-ops on POSIX
        cdef int vfd = libev.vfd_open(fd)
        libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, events)
        self.__watcher = <libev.ev_watcher*>&self._watcher
                        ^
------------------------------------------------------------

src/gevent/libev/corecext.pyx:1027:25: Cannot convert 'ev_watcher *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
            raise ValueError('illegal event mask: %r' % events)
        # All the vfd_functions are no-ops on POSIX
        cdef int vfd = libev.vfd_open(fd)
        libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, events)
        self.__watcher = <libev.ev_watcher*>&self._watcher
        self.__ss = &io_ss
                   ^
------------------------------------------------------------

src/gevent/libev/corecext.pyx:1028:20: Cannot convert 'start_and_stop *' to Python object

For now, I will pin to Cython<3.

@jamadden
Copy link
Member Author

jamadden commented May 6, 2020

The problems begin in 3.0a2 and continue through 3.0a4.

jamadden added a commit that referenced this issue May 6, 2020
The double-dunder name changes broke some things.

Fixes #1599
@jamadden
Copy link
Member Author

jamadden commented May 6, 2020

Re-opening pending cython/cython#3578

@jamadden jamadden reopened this May 6, 2020
@scoder
Copy link

scoder commented May 8, 2020

The errors that you got above are due to Cython now (mostly) following Python semantics on dunder names: cython/cython#3544

Specifically, as in Python, __somename now gives you a private, name-mangled attribute in classes. The obvious solution is to prefix the names only with a single underscore if they are not meant to be private to the class.

@jamadden
Copy link
Member Author

jamadden commented May 8, 2020

The errors that you got above are due to Cython now (mostly) following Python semantics on dunder names

Thank you. I did eventually manage to figure that out, and it makes sense. The error message was initially a bit confusing since it's a step removed.

jamadden added a commit that referenced this issue May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants