On 13 January 2016 at 17:50, Orion Poplawski <orion at cora.nwra.com> wrote: > Dimitri John Ledkov <xnox at ...> writes: > >> >> Hello, >> >> Building 0.23.4 fails on ubuntu with python 3.5. >> >> Full build log is at: >> > https://launchpadlibrarian.net/228728126/buildlog_ubuntu-xenial > -amd64.cython_0.23.4-0ubuntu1_BUILDING.txt.gz >> >> The what i think relevant portion of the build log is as follows: >> >> End-to-end asyncio_generators ... FAIL >> runTest (__main__.CythonRunTestCase) >> compiling (c) and running attr ... attr () >> Doctest: attr ... /usr/bin/python3.5 test_async_def_future.py >> >> Traceback (most recent call last): >> File "test_async_def_future.py", line 16, in <module> >> runloop() >> File "test_async_def_future.py", line 14, in runloop >> assert events == expected, events >> AssertionError: ['setup', 'setval', None] >> >> Any help resolving this would help. Is this a broken python3.5? or >> cython? or both? > > We are seeing the same thing building cython 0.23.4 on Fedora rawhide for > python 3.5.1: > > https://kojipkgs.fedoraproject.org//work/tasks/5210/12535210/build.log
We are seeing the same failure on openSUSE, and I think I have worked out part of the reason why.
I have been playing around with the failing unit test using travis and my own github fork. If I enable testing on python 3.5.1 or 3.5-dev the problem appears there too. Cython doesn't currently test against these, which is why the issue wasn't discovered earlier.
I have discovered that the change in behaviour between 3.5 and 3.5.1 occurs in line 224 of cython/tests/run/asyncio_generators.srctree
In this line, in python 3.5 the "await fut" statement returned the result of "fut", 123. In python 3.5.1+, however, it returns None instead. The result value is successfully getting set, as seen by checking "fut.get_result()" after the await, but the await is not returning it.
You would think this would be an upstream Python problem, so I tried it in a standalone python interpreter. However, the problem didn't happen, it worked as it did in 3.5. So I went back to the test and changed the extension of "async_def_future" from "pyx" to "py" and the problem disappeared!
So somehow cython is doing something different with await than normal python, and this is causing await to return None in python 3.5.1+. However, I do not know specifically what this is, or why it behaves differently in 3.5 and 3.5.1