Source: lazr.config
Severity: normal

Dear Maintainer,

This almost certainly isn't the right place to report this bug but I don't 
know where is any I feel I need to get this written down somewhere :)

If you rebuild the lazr.delegates package it gets a new
lazr.delegates-2.0.3-nspkg.pth file thanks (I think) to setuptools changes. The
new one makes the python3.5 tests fail like this:

(sid-amd64)root@aeglos:/build/lazr.config-dfPG10/lazr.config-2.2/.pybuild/pythonX.Y_3.5/build#
 python3.5 -m nose
E
======================================================================
ERROR: Failure: ImportError (No module named 'lazr.delegates')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/usr/lib/python3/dist-packages/nose/loader.py", line 418, in 
loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python3/dist-packages/nose/importer.py", line 47, in 
importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python3/dist-packages/nose/importer.py", line 94, in 
importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/lib/python3.5/imp.py", line 244, in load_module
    return load_package(name, filename)
  File "/usr/lib/python3.5/imp.py", line 216, in load_package
    return _load(spec)
  File "<frozen importlib._bootstrap>", line 693, in _load
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 697, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "./lazr/config/__init__.py", line 26, in <module>
    from lazr.config._config import *
  File "./lazr/config/_config.py", line 65, in <module>
    from lazr.delegates import delegate_to
ImportError: No module named 'lazr.delegates'

----------------------------------------------------------------------
Ran 1 test in 0.009s

The problem seems to be that sys.modules['lazr'].__path__ is set by the pth
file to a _frozen_importlib_external._NamespacePath rather than a regular list.
Hacking the pth file to set it to a list (by adding ";
sys.modules['lazr'].__path__ = list(sys.modules['lazr'].__path__)" to the end
of it) makes it work again. This might be a problem with Python itself,
setuptools, nose or something else, I just don't know. But it's horrid.

Cheers,
mwh



-- System Information:
Debian Release: stretch/sid
  APT prefers xenial-updates
  APT policy: (500, 'xenial-updates'), (500, 'xenial-security'), (500, 
'xenial'), (400, 'xenial-proposed'), (100, 'xenial-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.4.0-81-generic (SMP w/4 CPU cores)
Locale: LANG=en_NZ.UTF-8, LC_CTYPE=en_NZ.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Reply via email to