Public bug reported:

Binary package hint: python2.6

On Lucid, .pth and .egg-info files in /usr/lib/pymodules/python2.6 are
not being processed.  It's because of how it is included, with a .pth
file, IIRC.

This means that, for instance, bugs in repoze.what-1.0.8-py2.6-nspkg.pth
are not triggered. It means that all of the .egg-info and .pth files in
pymodules are pointless.  That in turn means that any namespace packages
there don't play nicely with the new zc.buildout because the .egg-info
files are not processed.  (I've carefully modified zc.buildout to mimic
the exact behavior of site.py so that the repoze problem is not
triggered; it would be really nice if the fix, whatever it is, still
worked with my zc.buildout release.)

I have other examples, but the best quick instructions I have to dupe
ATM are these. (1) apt install repoze.what.  (2) It is already broken,
but just to make sure, edit
/usr/lib/pymodules/python2.6/repoze.what-1.0.8-py2.6-nspkg.pth
(==/usr/share/pyshared/repoze.what-1.0.8-py2.6-nspkg.pth) to look
horrible (my example: http://pastebin.ubuntu.com/481083/ ).  (3) start
python, and note that there are no complaints (they would be of the
"site.py had problems, use -v for details" variety).

I'm pretty sure I see why this happens. The pymodules directory is added
with a .pth file.  That goes into lines 152-154 of site.py, in the
addpackage module.  For reference, that's the last three lines of this
snippet.

        for line in f:
            if line.startswith("#"):
                continue
            if line.startswith(("import ", "import\t")):
                exec line
                continue
            line = line.rstrip()
            dir, dircase = makepath(sitedir, line)
            if not dircase in known_paths and os.path.exists(dir):
                sys.path.append(dir)
                known_paths.add(dircase)

That adds the path to sys.path but does *not* call addsitedir on it, so
reading the directory for special files is not recursive.  I *think*
that's a Python behavior, so I'd prefer not to change it locally,
myself.

My naive thought is that pymodules ought to be included within
site.addsitepackages, the way the rest of the directories like this are,
but maybe that's a bad idea for some reason.

** Affects: python2.6 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
.pth and .egg-info files in /usr/lib/pymodules/python2.6 are not being processed
https://bugs.launchpad.net/bugs/621348
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to