Bug 2026340

Summary: python-osrf-pycommon fails to build with Python 3.11: AttributeError: module 'asyncio' has no attribute 'coroutine'
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-osrf-pycommonAssignee: Scott K Logan <logans>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 36CC: logans, mhroncok, richmattes, robotics, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-osrf-pycommon-2.0.0-1.fc37 python-osrf-pycommon-2.0.0-1.fc36 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-02-12 18:58:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2016048    

Description Tomáš Hrnčiar 2021-11-24 12:08:55 UTC
python-osrf-pycommon fails to build with Python 3.11.0a2.

======================================================================
ERROR: Failure: AttributeError (module 'asyncio' has no attribute 'coroutine')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/nose/loader.py", line 416, in loadTestsFromName
    module = self.importer.importFromPath(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/imp.py", line 235, in load_module
    return load_source(name, filename, file)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/imp.py", line 172, in load_source
    module = _load(spec)
             ^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 721, in _load
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 897, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/builddir/build/BUILD/osrf_pycommon-0.2.1/tests/unit/test_process_utils/test_async_execute_process.py", line 7, in <module>
    from .impl_aep_asyncio import run
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/osrf_pycommon-0.2.1/tests/unit/test_process_utils/impl_aep_asyncio.py", line 10, in <module>
    @asyncio.coroutine
     ^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'

----------------------------------------------------------------------
Ran 24 tests in 0.149s

FAILED (errors=1)

The @asyncio.coroutine decorator enabling legacy generator-based coroutines to be compatible with async/await code. The function has been deprecated since Python 3.8 and the removal was initially scheduled for Python 3.10. Use async def instead. (Contributed by Illia Volochii in bpo-43216.)

https://bugs.python.org/issue43216
https://docs.python.org/3.11/whatsnew/3.11.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/02985301-python-osrf-pycommon/

For all our attempts to build python-osrf-pycommon with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/python-osrf-pycommon/

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.11:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/

Let us know here if you have any questions.

Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11.
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 2022-02-08 21:26:04 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 2 Fedora Update System 2022-02-12 18:56:26 UTC
FEDORA-2022-bc7e24485f has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-bc7e24485f

Comment 3 Fedora Update System 2022-02-12 18:58:17 UTC
FEDORA-2022-bc7e24485f has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 4 Fedora Update System 2022-02-12 20:51:55 UTC
FEDORA-2022-3663c158d2 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-3663c158d2

Comment 5 Fedora Update System 2022-02-12 20:55:12 UTC
FEDORA-2022-3663c158d2 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.