Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 588040 - dev-python/python-uinput-0.10.2 and earlier: NameError: name 'ABS_MAX' is not defined
Summary: dev-python/python-uinput-0.10.2 and earlier: NameError: name 'ABS_MAX' is not...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-05 05:56 UTC by Wes
Modified: 2020-04-24 06:15 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to fix this problem. (acmondor-python-uinput-0.10.2.patch,977 bytes, patch)
2017-06-06 15:24 UTC, acmondor
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wes 2016-07-05 05:56:02 UTC
Hi, I noticed today that the in-tree versions of python-uinput no longer work on kernel 4.6.3 and possibly other recent kernel versions.  They emerge fine but when imported throw a NameError:

Python 3.4.4 (default, Jun 11 2016, 18:42:08) 
[GCC 5.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import uinput
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.4/site-packages/uinput/__init__.py", line 42, in <module>
    _ABS_CNT = ABS_MAX[1] + 1
NameError: name 'ABS_MAX' is not defined
>>> 



The current git head from https://github.com/tuomasjjrasanen/python-uinput resolves this (but they haven't tagged a new release yet):

Python 3.4.4 (default, Jun 11 2016, 18:42:08) 
[GCC 5.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import uinput
>>> 


Appears to be resolved by this commit: https://github.com/tuomasjjrasanen/python-uinput/commit/7f9f4e317be3b31c17e1cf5e53df179e2ac4fe4e

Cheers,
Wes
Comment 1 Account removed 2017-03-13 15:59:37 UTC
I can confirm that this is still an issue.
updating the ebuild to =python-uinput-0.11.2 was as easy as renaming the outdated one from portage.
Comment 2 acmondor 2017-06-06 15:24:10 UTC
Created attachment 475364 [details, diff]
Patch to fix this problem.

The problem described in this bug report is due to newer kernels defining input events in a different file than was done in the previously.

The attached patch (created from https://github.com/tuomasjjrasanen/python-uinput/commit/9e22407491b0512c2ad8db7a495b9cdd7568d601) resolves this issue while maintaining backwards compatiblity with older kernels.

If anyone wants to try this patch for themselves, they just need to place the attached patch file into the following directory and then re-emerge uinput:

  /etc/portage/patches/dev-python/python-uinput-0.10.2

Note that without this patch the uinput build will generate the following as zero length files when built using a newer kernel:

  /usr/lib64/python2.7/site-packages/uinput/ev.py
  /usr/lib64/python3.4/site-packages/uinput/ev.py
Comment 3 Fab 2017-12-07 08:36:35 UTC
Confirming.

In my case, because of this bug, I'm getting a configure error while trying to build a software :
> checking python2.7 module: uinput... no
> configure: error: Requires Python uinput and libsuinput

Thanks for the patch.
Comment 4 Luca Santarelli 2019-01-05 17:37:57 UTC
Up.

Bug is confirmed.

Patch (from upstream) is attached.

Issue could be fixed in an easier way by version bump-ing the ebuild to latest from upstream (0.11.2 18 sep 2016 - two years ago) and maybe even marked stable.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-04-24 06:15:46 UTC
Mass-closing bugs for removed packages.