Bug 1792067 - python-curio fails to build with Python 3.9: async/await not allowed inside an async_thread context block
Summary: python-curio fails to build with Python 3.9: async/await not allowed inside a...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-curio
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Carl George 🤠
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON39
TreeView+ depends on / blocked
 
Reported: 2020-01-16 23:22 UTC by Miro Hrončok
Modified: 2020-03-18 09:49 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-18 04:13:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miro Hrončok 2020-01-16 23:22:36 UTC
python-curio fails to build with Python 3.9.0a2.

ERROR    curio.kernel:kernel.py:768 Task Crash: Task(id=598, name='test_async_thread_call.<locals>.main', state='TERMINATED')
Traceback (most recent call last):
  File "/builddir/build/BUILDROOT/python-curio-0.9-5.fc32.x86_64/usr/lib/python3.9/site-packages/curio/kernel.py", line 736, in _run_coro
    trap = current._send(current.next_value)
  File "/builddir/build/BUILDROOT/python-curio-0.9-5.fc32.x86_64/usr/lib/python3.9/site-packages/curio/task.py", line 167, in _task_runner
    return await coro
  File "/builddir/build/BUILD/curio-0.9/tests/test_thread.py", line 296, in main
    await coro1()
  File "/builddir/build/BUILD/curio-0.9/tests/test_thread.py", line 289, in coro1
    async with spawn_thread():
  File "/builddir/build/BUILDROOT/python-curio-0.9-5.fc32.x86_64/usr/lib/python3.9/site-packages/curio/thread.py", line 186, in __aenter__
    raise RuntimeError("async/await not allowed inside an async_thread context block")
RuntimeError: async/await not allowed inside an async_thread context block
ERROR    curio.debug:debug.py:56 Task(id=598, name='test_async_thread_call.<locals>.main', state='TERMINATED') crashed
Traceback (most recent call last):
  File "/builddir/build/BUILDROOT/python-curio-0.9-5.fc32.x86_64/usr/lib/python3.9/site-packages/curio/kernel.py", line 736, in _run_coro
    trap = current._send(current.next_value)
  File "/builddir/build/BUILDROOT/python-curio-0.9-5.fc32.x86_64/usr/lib/python3.9/site-packages/curio/task.py", line 167, in _task_runner
    return await coro
  File "/builddir/build/BUILD/curio-0.9/tests/test_thread.py", line 296, in main
    await coro1()
  File "/builddir/build/BUILD/curio-0.9/tests/test_thread.py", line 289, in coro1
    async with spawn_thread():
  File "/builddir/build/BUILDROOT/python-curio-0.9-5.fc32.x86_64/usr/lib/python3.9/site-packages/curio/thread.py", line 186, in __aenter__
    raise RuntimeError("async/await not allowed inside an async_thread context block")
RuntimeError: async/await not allowed inside an async_thread context block

I don't know yet where is this coming from.


For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.9/fedora-rawhide-x86_64/01148892-python-curio/

For all our attempts to build python-curio with Python 3.9, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/package/python-curio/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.9:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Let us know here if you have any questions.

Python 3.9 will be included in Fedora 33. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.9.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Ben Cotton 2020-02-11 17:34:04 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 2 Miro Hrončok 2020-03-16 12:59:20 UTC
Carl, could you please have look and report this upstream if needed? Thanks.

Comment 3 Carl George 🤠 2020-03-18 04:13:29 UTC
Looks like upstream added tests that make outbound internet connections [0].  I sorted it out with a pytest custom marker, but it looks like upstream doesn't typically accept pull requests.  I've opened an issue to see if they're interested [1].  I've added it as a patch in the spec file, and it now builds on Rawhide [2] as well as locally with the @python/python3.9 COPR.

[0]: https://github.com/dabeaz/curio/commit/96ed9c5375ef6c24b373870f757994268cae36a8
[1]: https://github.com/dabeaz/curio/issues/320
[2]: https://bodhi.fedoraproject.org/updates/FEDORA-2020-c683439106

Comment 4 Miro Hrončok 2020-03-18 09:49:46 UTC
Thank You!


Note You need to log in before you can comment on or make changes to this bug.