[Python-modules-team] Bug#851137: Requires a dependency on missing 'scandir' module
Wolodja Wentland
debian at babilen5.org
Thu Jan 12 11:11:08 UTC 2017
Package: python-pathlib2
Version: 2.2.0-1
Severity: grave
Dear Maintainer,
thank you for packaging python-pathlib2, but it appears to be unusable at the moment. Using an up-to-date sid version, unsurprisingly, results in the following error:
>>> import pathlib2
Traceback (most recent call last):
File "<input>", line 1, in <module>
import pathlib2
File "/usr/lib/python2.7/dist-packages/bpython/curtsiesfrontend/repl.py", line 257, in load_module
module = pkgutil.ImpLoader.load_module(self, name)
File "/usr/lib/python2.7/pkgutil.py", line 246, in load_module
mod = imp.load_module(fullname, self.file, self.filename, self.etc)
File "/usr/lib/python2.7/dist-packages/pathlib2.py", line 46, in <module>
from scandir import scandir as os_scandir
ImportError: No module named scandir
Which is due to the following code in pathlib2:
try:
from os import scandir as os_scandir
except ImportError:
from scandir import scandir as os_scandir
where pathlib2 tries to import 'scandir' from the stdlib in Python >= 3.5 (cf.
[0]) and then falls back to benhoyt's scandir module [1]. This follows the
pattern Ben documented for scandir [2], but fails on Debian at the moment as
'scandir' has not yet been packaged yet (cf. ITP/RFP [3]) and this package
therefore can't easily include a dependency on it.
It appears as if the best way to fix this bug would be by packaging scandir for
Python 2 and by including a Depends on the new package in this one.
[0] https://docs.python.org/3.6/library/os.html#os.scandir
[1] https://github.com/benhoyt/scandir
[2] https://github.com/benhoyt/scandir#now-included-in-a-python-near-you
[3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=711388
Thank you!
Wolodja
-- System Information:
Debian Release: stretch/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 4.8.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.utf-8, LC_CTYPE=en_GB.utf-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages python-pathlib2 depends on:
ii python-six 1.10.0-3
pn python:any <none>
python-pathlib2 recommends no packages.
python-pathlib2 suggests no packages.
-- no debconf information
More information about the Python-modules-team
mailing list