This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitti
Recipients barry, doko, michael.foord, pitrou, pitti, python-dev
Date 2013-11-29.07:58:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1385711938.35.0.556718424579.issue19352@psf.upfronthosting.co.za>
In-reply-to
Content
More precisely, it broke unittest's discovery (not specific to autopilot). For any installed test, you now get:

$ python -m unittest discover lazr
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/unittest/__main__.py", line 12, in <module>
    main(module=None)
  File "/usr/lib/python2.7/unittest/main.py", line 94, in __init__
    self.parseArgs(argv)
  File "/usr/lib/python2.7/unittest/main.py", line 113, in parseArgs
    self._do_discovery(argv[2:])
  File "/usr/lib/python2.7/unittest/main.py", line 214, in _do_discovery
    self.test = loader.discover(start_dir, pattern, top_level_dir)
  File "/usr/lib/python2.7/unittest/loader.py", line 206, in discover
    tests = list(self._find_tests(start_dir, pattern))
  File "/usr/lib/python2.7/unittest/loader.py", line 287, in _find_tests
    for test in self._find_tests(full_path, pattern):
  File "/usr/lib/python2.7/unittest/loader.py", line 287, in _find_tests
    for test in self._find_tests(full_path, pattern):
  File "/usr/lib/python2.7/unittest/loader.py", line 267, in _find_tests
    raise ImportError(msg % (mod_name, module_dir, expected_dir))
ImportError: 'test_error' module incorrectly imported from '/usr/lib/python2.7/dist-packages/lazr/restfulclient/tests'. Expected '/usr/lib/python2.7/dist-packages/lazr/restfulclient/tests'. Is this module globally installed?

I reverted this patch in Ubuntu for now as a quickfix.

This might be specific how Debian installs Python 2 modules. Packages ship them in /usr/share/pyshared/<modulename>/, and for every supported 2.X version, ship /usr/lib/python2.X/dist-packages/<modulename>/ which contains only the directories and *.pyc files, but symlinks the *.py files to /usr/share/pyshared/<modulename>/../*.py

So, it might be that upstream does not support this symlink layout, but it's the best thing to avoid having to install multiple *.py copies (this is all solved in a much more elegant way with Python 3, of course). But it would be nice if unittest's discovery could still cope with this.

Thanks!
History
Date User Action Args
2013-11-29 07:58:58pittisetrecipients: + pitti, barry, doko, pitrou, michael.foord, python-dev
2013-11-29 07:58:58pittisetmessageid: <1385711938.35.0.556718424579.issue19352@psf.upfronthosting.co.za>
2013-11-29 07:58:58pittilinkissue19352 messages
2013-11-29 07:58:56pitticreate