[Python-modules-team] Bug#890621: python3-keyrings.alt 2.2-2 module.__file__ is None, causing regrtest.py to fail
Ron Lovell
ron163264 at gmail.com
Fri Feb 16 20:32:16 UTC 2018
Package: python3-keyrings.alt
Version: 2.2-2
Severity: important
Dear Maintainer,
When package 'keyrings' from python3-keyrings.alt is imported under
python3.6, the module object has a __file__ attribute with a value None.
This causes early failure of the Python 3.6 regression tests from
libpython3.6-testsuite.
The problem occurs starting at line 60 of
/usr/lib/python3.6/test/libregrtest/setup.py, within a loop on the
module objects listed in sys.modules.values(). The module object for
'keyrings' has a __file__ attribute, but it is None, so the call to
os.path.abspath() fails with a TypeError on the non-string argument
passed to it.
Please note that when the 'keyrings' package from python3-keyrings.alt is
imported into python3.7 (python3.7_3.7.0~b1-1_amd64), the
'keyrings' module object has no attribute __file__. Hence the tests
from libpython3.7-testsuite run, even though libregrtest/setup.py
is identical to the 3.6 version.
Note also that when module keyrings.alt (as opposed to package
keyrings) is imported in python3.6, the 'keyrings.alt' module object
has a proper string-valued __file__ attribute. That doesn't help with
the regression tests, however, since a 'keyrings' module object is
listed in sys.modules.values().
It would appear that initialized module objects from import of
package 'keyrings' should not have a __file__ attribute at all,
which is consistent with python3.7's initialization.
I happen to have python3-keyrings.alt installed because
python3-jupyter-core recs python3-pip, which recs python3-wheel, which
recs python3-keyrings.alt. I could probably remove the package without
missing it.
But my current workaround, and one you might consider, is to modify
/usr/lib/python3.6/test/libregrtest/setup.py:
60c60
< if hasattr(module, '__file__'):
---
> if hasattr(module, '__file__') and module.__file__ != None:
-- System Information:
Debian Release: buster/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.14.0-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages python3-keyrings.alt depends on:
ii python3 3.6.4-1
ii python3-crypto 2.6.1-8
ii python3-six 1.11.0-2
python3-keyrings.alt recommends no packages.
Versions of packages python3-keyrings.alt suggests:
ii gir1.2-gnomekeyring-1.0 3.12.0-1+b2
ii python3-gi 3.26.1-2
-- no debconf information
More information about the Python-modules-team
mailing list