Bug 2102128 - python-evdev fails import on Python 3.11
Summary: python-evdev fails import on Python 3.11
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-evdev
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: gvalkov
QA Contact: Fedora Extras Quality Assurance
URL: https://koschei.fedoraproject.org/pac...
Whiteboard:
: 2100362 (view as bug list)
Depends On:
Blocks: F37FTBFS
TreeView+ depends on / blocked
 
Reported: 2022-06-29 11:19 UTC by Jitka Plesnikova
Modified: 2022-07-26 20:15 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-07-26 20:15:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jitka Plesnikova 2022-06-29 11:19:07 UTC
Description of problem:
Package libratbag fails to build from source in Fedora Rawhide. It is probably related to update to Python 3.11


7/8 ratbagctl-test    FAIL            0.17s   exit status 1
>>> LIBRATBAG_DATA_DIR=/builddir/build/BUILD/libratbag-0.16/data/devices MALLOC_PERTURB_=37 /builddir/build/BUILD/libratbag-0.16/redhat-linux-build/ratbagctl.test -v
――――――――――――――――――――――――――――――――――――― ✀  ―――――――――――――――――――――――――――――――――――――
stderr:
Traceback (most recent call last):
  File "/builddir/build/BUILD/libratbag-0.16/redhat-linux-build/ratbagctl.test", line 32, in <module>
    import toolbox
    ^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/libratbag-0.16/redhat-linux-build/toolbox.py", line 110, in <module>
    ratbagctl = import_non_standard_path(RATBAGCTL_NAME, RATBAGCTL_PATH)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/libratbag-0.16/redhat-linux-build/toolbox.py", line 49, in import_non_standard_path
    module = imp.load_module(name, fp, os.path.basename(path), ('.py', 'rb', imp.PY_SOURCE))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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 "ratbagctl", line 24, in <module>
    import evdev
    ^^^^^^^^^^^^
  File "/usr/lib64/python3.11/site-packages/evdev/__init__.py", line 5, in <module>
    from evdev.device import DeviceInfo, InputDevice, AbsInfo, EvdevError
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/site-packages/evdev/device.py", line 12, in <module>
    from evdev.eventio_async import EventIO, EvdevError
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/site-packages/evdev/eventio_async.py", line 63, in <module>
    class ReadIterator(object):
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/site-packages/evdev/eventio_async.py", line 88, in ReadIterator
    @asyncio.coroutine
     ^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'. Did you mean: 'coroutines'?
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
8/8 test-context      OK              0.53s
Summary of Failures:
7/8 ratbagctl-test    FAIL            0.17s   exit status 1
Ok:                 7   

Dependency changes from the last successful build:
https://koschei.fedoraproject.org/build/13101030

Additional info:
This package is tracked by Koschei. See:
https://koschei.fedoraproject.org/package/libratbag

Comment 1 Peter Hutterer 2022-07-11 01:18:15 UTC
Looks like this is an issue with python-evdev, not libratbag itself.

Comment 2 Peter Hutterer 2022-07-11 05:54:46 UTC
Basic problem: @asyncio.coroutine was removed in python 3.11 which we have in F37 now. This makes the import fail, definitely a python-evdev issue, not a libratbag issue.

Upstream PR but not merged yet: https://github.com/gvalkov/python-evdev/pull/174

Comment 3 gvalkov 2022-07-17 22:08:02 UTC
Upstream PR merged. Version 1.6.0 is now on pypi and on its way to rawhide: https://bodhi.fedoraproject.org/updates/FEDORA-2022-cff1e24afc

Comment 4 Peter Hutterer 2022-07-25 03:44:37 UTC
yep, thanks, confirmed in a podman container here. I reckon you can close this bug with RAWHIDE

Comment 5 Vitaly 2022-07-26 17:52:43 UTC
*** Bug 2100362 has been marked as a duplicate of this bug. ***


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