Bug#397111: Bug#382252: Python PATH problem
tags 397111 - patch tags 397111 + wontfix thanks Ignoring the .pyc and .pyo files would change the behaviour compared to upstream; rejecting that patch. It's explicitely allowed to use the byte compiled files without the source files. I will close this report. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#382252: Python PATH problem
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 I do not know python enough to know what to do now. Does someone have any idea ? Can someone else reproduce the bug ? Happy new year Vincent -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#382252: Python PATH problem
Le mercredi 03 janvier 2007 à 09:58 +0100, Vincent Danjean a écrit : 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 I do not know python enough to know what to do now. Does someone have any idea ? Can someone else reproduce the bug ? mdiff.py does import bdiff which looks for bdiff.so in the same directory. On your system, mdiff.py is is in /var/lib/python-support/python2.4/mercurial/ which is the correct place for packages handled by python-support, while on the user's system it is in /usr/lib/python2.4/site-packages/mercurial/. Therefore you need to understand how the file ended up in this place. Cheers, -- .''`. : :' : We are debian.org. Lower your prices, surrender your code. `. `' We will add your hardware and software distinctiveness to `-our own. Resistance is futile.
Bug#382252: 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[EMAIL PROTECTED] OOOhttp://www.madism.org pgpU6lEFyRWsp.pgp Description: PGP signature
Bug#382252: Python PATH problem
Josselin Mouette a écrit : mdiff.py does import bdiff which looks for bdiff.so in the same directory. On your system, mdiff.py is is in /var/lib/python-support/python2.4/mercurial/ which is the correct place for packages handled by python-support, while on the user's system it is in /usr/lib/python2.4/site-packages/mercurial/. Therefore you need to understand how the file ended up in this place. Thank for your help (and Pierre too). Wouter, can you give me the results of : $ dpkg -S mercurial $ ls -l /usr/lib/python*/site-packages/mercurial/ Can you also tell me if you have installed mercurial from upstream sources ? Cheers,
Bug#382252: Python PATH problem
On Wed, Jan 03, 2007 at 11:18:49AM +0100, Vincent Danjean wrote: $ dpkg -S mercurial mercurial: /usr/share/mercurial/templates/gitweb/tags.tmpl mercurial: /usr/share/mercurial/templates/filelog.tmpl mercurial: /usr/share/python-support/mercurial/mercurial/remoterepo.py mercurial: /usr/share/doc/mercurial/examples/vim/hgcommand.vim.gz mercurial: /usr/share/mercurial/templates/rss mercurial: /usr/share/mercurial/templates/gitweb/fileannotate.tmpl mercurial: /usr/share/python-support/mercurial/mercurial/hgweb/wsgicgi.py mercurial: /usr/share/mercurial/templates/old/changelogentry.tmpl mercurial: /etc/mercurial mercurial: /usr/share/mercurial/templates/gitweb/header.tmpl mercurial: /usr/share/mercurial/templates/index.tmpl mercurial: /usr/share/python-support/mercurial/mercurial/verify.py mercurial: /usr/share/python-support/mercurial/mercurial/mdiff.py mercurial: /usr/share/python-support/mercurial/mercurial/demandload.py mercurial: /usr/share/mercurial/templates/shortlogentry.tmpl mercurial: /usr/share/mercurial/templates/old/manifest.tmpl mercurial: /usr/share/doc/mercurial/examples/git-viz/git-rev-list mercurial: /usr/share/mercurial/templates mercurial: /usr/share/python-support/mercurial/hgext/transplant.py mercurial: /usr/share/mercurial/templates/old/filerevision.tmpl mercurial: /usr/share/python-support/mercurial/mercurial/revlog.py mercurial: /usr/share/mercurial/templates/filerevision.tmpl mercurial: /usr/share/mercurial/templates/shortlog.tmpl mercurial: /usr/share/doc/mercurial mercurial: /usr/share/python-support/mercurial/hgext/bugzilla.py mercurial: /usr/share/python-support/mercurial/hgext/hbisect.py mercurial: /usr/share/python-support/mercurial/mercurial/bundlerepo.py mercurial: /usr/share/python-support/mercurial/mercurial/changegroup.py mercurial: /usr/share/mercurial/templates/gitweb/filediff.tmpl mercurial: /usr/share/mercurial/templates/gitweb/error.tmpl mercurial: /usr/share/mercurial/templates/changelogentry.tmpl mercurial: /usr/share/python-support/mercurial/mercurial/sshrepo.py mercurial: /usr/share/mercurial/templates/map-cmdline.changelog mercurial: /usr/share/mercurial/templates/static/hgicon.png mercurial: /usr/share/python-support/mercurial/mercurial/util.py mercurial: /usr/share/doc/mercurial/examples/hgsh/hgsh.c.gz mercurial: /usr/share/python-support/mercurial mercurial: /usr/share/mercurial/templates/search.tmpl mercurial: /usr/share/python-support/mercurial/mercurial/packagescan.py mercurial: /usr/share/mercurial/templates/template-vars.txt mercurial: /usr/share/mercurial/templates/changelog.tmpl mercurial: /usr/share/python-support/mercurial/hgext/notify.py mercurial: /usr/share/python-support/mercurial/mercurial/version.py mercurial: /usr/lib/python-support/mercurial/python2.4/mercurial/bdiff.so mercurial: /usr/share/doc/mercurial/examples/hg-ssh mercurial: /usr/share/python-support/mercurial/mercurial/templates mercurial: /usr/share/mercurial/templates/old/changelog.tmpl mercurial: /usr/share/python-support/mercurial/hgext/acl.py mercurial: /usr/share/python-support/mercurial/mercurial/ui.py mercurial: /usr/share/python-support/mercurial/mercurial/node.py mercurial: /usr/share/doc/mercurial/examples/hgdiff mercurial: /usr/share/mercurial/templates/old/search.tmpl mercurial: /usr/share/mercurial/templates/rss/header.tmpl mercurial: /usr/share/python-support/mercurial/mercurial/__init__.py mercurial: /usr/share/doc/mercurial/examples/vim mercurial: /usr/share/doc/mercurial/changelog.Debian.gz mercurial: /usr/share/doc/mercurial/copyright mercurial: /usr/share/python-support/mercurial/hgext/hgk.py mercurial: /usr/share/python-support/mercurial/mercurial/__version__.py mercurial: /usr/share/python-support/mercurial/mercurial/transaction.py mercurial: /usr/share/mercurial/hgk mercurial: /usr/lib/python-support/mercurial mercurial: /usr/share/python-support/mercurial/mercurial/merge.py mercurial: /usr/share/python-support/mercurial/mercurial/httprangereader.py mercurial: /usr/share/python-support/mercurial/mercurial/templater.py mercurial: /usr/share/mercurial/templates/old/shortlogentry.tmpl mercurial: /usr/share/python-support/mercurial/mercurial/patch.py mercurial: /usr/share/python-support/mercurial/mercurial/dirstate.py mercurial: /usr/share/mercurial/templates/static/style.css mercurial: /usr/share/doc/mercurial/examples/favicon.ico mercurial: /usr/share/python-support/mercurial/mercurial/changelog.py mercurial: /usr/share/emacs/site-lisp/mercurial.el mercurial: /usr/share/mercurial/templates/old/tags.tmpl mercurial: /usr/share/mercurial/templates/filediff.tmpl mercurial: /usr/share/doc/mercurial/examples/zsh_completion.gz mercurial: /usr/share/doc/mercurial/README mercurial: /usr/share/python-support/mercurial/hgext/win32text.py mercurial: /usr/share/doc/mercurial/examples/git-viz/git-rev-tree mercurial: /usr/share/python-support/mercurial/hgext/extdiff.py mercurial: /usr/share/mercurial/templates/footer.tmpl mercurial:
Bug#382252: Python PATH problem
On Wed, Jan 03, 2007 at 10:25:07AM +0100, Pierre Habouzit wrote: 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 FYI, I already tried purging the mercurial package. I checked if I could find any more lingering files, and found nothing at the time. I could do this again and check specifically for that directory, if you wish. (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. I uninstalled python2.3 and removed all bytecode a couple of days ago. I also triggered bytecode recompilation with dpkg-reconfigure python2.4 a few times. signature.asc Description: Digital signature
Bug#397111: Bug#382252: Python PATH problem
Josselin Mouette wrote: mdiff.py does import bdiff which looks for bdiff.so in the same directory. On your system, mdiff.py is is in /var/lib/python-support/python2.4/mercurial/ which is the correct place for packages handled by python-support, while on the user's system it is in /usr/lib/python2.4/site-packages/mercurial/. Therefore you need to understand how the file ended up in this place. Wouter Cloetens wrote: $ ls -l /usr/lib/python*/site-packages/mercurial/ -rw-r--r-- 1 root root134 Jun 1 2006 __init__.pyc -rw-r--r-- 1 root root168 Jun 1 2006 __version__.pyc -rw-r--r-- 1 root root 5494 Jun 1 2006 appendfile.pyc -rw-r--r-- 1 root root 7589 Jun 1 2006 archival.pyc ... etc ... This is #397111 cropping up again. Python really shouldn't import modules from .pyc and .pyo files unless the original .py file still exists alongside them. -- Sam Morris http://robots.org.uk/ PGP key id 1024D/5EA01078 3412 EA18 1277 354B 991B C869 B219 7FDB 5EA0 1078 signature.asc Description: This is a digitally signed message part
Bug#382252: Python PATH problem
# sorry pal but mishandling *.pyc files is a policy violation. severity 382252 serious thanks $ ls -l /usr/lib/python*/site-packages/mercurial/ [.. lots of *.pyc ..] Can you also tell me if you have installed mercurial from upstream sources ? he does not needs to, having run hg as root is enough to produce the *.pyc if your package (even against the previous policy) did not managed them. To Wouter: to resolve your problem, just rm -rf /usr/lib/python*/site-packages/mercurial. You can do that safely, that'll solve your problem. Cheers, -- ·O· Pierre Habouzit ··O[EMAIL PROTECTED] OOOhttp://www.madism.org pgpGNDrwkbKJS.pgp Description: PGP signature
Bug#382252: Python PATH problem
On Wed, Jan 03, 2007 at 01:04:37PM +0100, Pierre Habouzit wrote: To Wouter: to resolve your problem, just rm -rf /usr/lib/python*/site-packages/mercurial. You can do that safely, that'll solve your problem. Success! Many thanks! signature.asc Description: Digital signature
Bug#382252: Python PATH problem
Wouter Cloetens a écrit : On Wed, Jan 03, 2007 at 01:04:37PM +0100, Pierre Habouzit wrote: To Wouter: to resolve your problem, just rm -rf /usr/lib/python*/site-packages/mercurial. You can do that safely, that'll solve your problem. Success! Many thanks! You need to remove /usr/lib/python*/site-packages/hgext, too. I just upload a new version of the package that will do that automatically. You can find it on my repo[1] now or on all debian mirrors in a few hours. Best regards Vincent [1]: http://people.debian.org/~vdanjean/debian/pool/main/m/mercurial
Bug#382252: Python PATH problem
severity 382252 important thanks On Wed, Jan 03, 2007 at 01:04:37PM +0100, Pierre Habouzit wrote: # sorry pal but mishandling *.pyc files is a policy violation. severity 382252 serious thanks $ ls -l /usr/lib/python*/site-packages/mercurial/ [.. lots of *.pyc ..] Can you also tell me if you have installed mercurial from upstream sources ? he does not needs to, having run hg as root is enough to produce the *.pyc if your package (even against the previous policy) did not managed them. Um, isn't this only the case if the user was upgrading from an old version of the package that's no longer in the archive? If so, there's nothing RC about this because mercurial wasn't included in sarge. -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. [EMAIL PROTECTED] http://www.debian.org/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#382252: Python PATH problem
Steve Langasek a écrit : On Wed, Jan 03, 2007 at 01:04:37PM +0100, Pierre Habouzit wrote: he does not needs to, having run hg as root is enough to produce the *.pyc if your package (even against the previous policy) did not managed them. Um, isn't this only the case if the user was upgrading from an old version of the package that's no longer in the archive? If so, there's nothing RC about this because mercurial wasn't included in sarge. Even if it is not RC, it would be great if the fix were included in etch. This would allow me to remove this hack in lenny. I submitted a 0.9.1-1+etch1 to testing-proposed-updates with only this fix that I hope it will be accepted. Best regards, Vincent