[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Python PATH problem



On Wed, Jan 03, 2007 at 09:58:53AM +0100, Vincent Danjean wrote:
>   Hi,
> 
>   I'm the maintainer of mercurial. At least one of the users has a
> problem with loading python modules.
>   Can someone look at bug #382252 ?
> 
>   In short,
> echo 'import sys; print sys.path; from mercurial import bdiff' | python2.4
> works on my system, but not on its one.
> Both have '/var/lib/python-support/python2.4' in sys.path
> Both have /var/lib/python-support/python2.4/mercurial/bdiff.so a symlink to
> /usr/lib/python-support/mercurial/python2.4/mercurial/bdiff.so that is a
> "ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped"

  from the strace he says that the package is searched under
$path/bdiff.so instead of mercurial/bdiff.so like it should. though it
searches in /usr/lib/python2.4/site-packages/mercurial/bdiff.so first.

  so my guess, but I may be wrong, is that there is old byte compiled
things from your package before the new policy, and that when
/usr/bin/hg does `from mercurial import mdiff` it finds the mdiff.pyc
from /usr/lib/python2.4/site-packages/mercurial/mdiff.pyc

  mdiff.pyc does `import bdiff` and not from mercurial import bdiff. so
it searches in paths stripped from the 'mercurial' part.

  and the user can't do from mercurial import bdiff either because
/usr/lib/python2.4/site-packages/mercurial/ comes first in the path.

  I can't say I'm right here, you should ask the user, though if that's
the case, then:
  (1) it's your fault
  (2) it's RC (serious) and that must be fixed for etch.
  (3) the solution is to rm -rf /usr/lib/python*/site-packages/mercurial/
      (yes * because you presumably left python2.3 bytecode over too)
      from the postinst. you will be able to drop that upgrade stanza
      after the etch release.
-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

Attachment: pgpf5BsC3OHZF.pgp
Description: PGP signature


Reply to: