Package: python2.4 Version: 2.4.4-6 Severity: normal Tags: patch Hi, inspect.getabsfile() reports wrong values for functions defined in modules in /usr/lib/python2.4
$ pwd /home/arno $ python -c "import inspect, urllib2; print inspect.getabsfile(urllib2.urlopen)" /home/arno/urllib2.py it should be: /usr/lib/python2.4/urllib2.py Some people have already noticed that behaviour: http://bugs.python.org/issue1666807 It's because co_filename in urllib2.pyc does not report an absolute path. It can be fixed by giving absolute paths to py_compile.py in postinst script. I'll attach a fix suggestion. It's for python2.4, but I think it should work also for python2.5 (didn't test though). arno. -- System Information: Debian Release: lenny/sid APT prefers unstable APT policy: (500, 'unstable') Architecture: i386 (i686) Kernel: Linux 2.6.22custom Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages python2.4 depends on: ii libbz2-1.0 1.0.3-7 high-quality block-sorting file co ii libc6 2.7-2 GNU C Library: Shared libraries ii libdb4.6 4.6.21-4 Berkeley v4.6 Database Libraries [ ii libncursesw5 5.6+20071103-1 Shared libraries for terminal hand ii libreadline5 5.2-3 GNU readline and history libraries ii libssl0.9.8 0.9.8g-3 SSL shared libraries ii mime-support 3.39-1 MIME files 'mime.types' & 'mailcap ii python2.4-minimal 2.4.4-6 A minimal subset of the Python lan python2.4 recommends no packages. -- no debconf information
diff -Nur python2.4-2.4.4/debian/PVER-minimal.postinst.in python2.4-2.4.4~/debian/PVER-minimal.postinst.in --- python2.4-2.4.4/debian/PVER-minimal.postinst.in 2007-11-28 22:44:25.000000000 +0100 +++ python2.4-2.4.4~/debian/PVER-minimal.postinst.in 2007-11-28 22:35:29.000000000 +0100 @@ -4,8 +4,7 @@ if [ "$1" = configure ]; then ( - cd /usr/lib/@PVER@ - files=$(dpkg -L @[EMAIL PROTECTED] | sed -n '/\.py$/s,^/usr/lib/@PVER@/,,p') + files=$(dpkg -L @[EMAIL PROTECTED] | sed -n '/^\/usr\/lib\/@[EMAIL PROTECTED]/.*\.py$/p') /usr/bin/@PVER@ /usr/lib/@PVER@/py_compile.py $files if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then /usr/bin/@PVER@ -O /usr/lib/@PVER@/py_compile.py $files diff -Nur python2.4-2.4.4/debian/PVER.postinst.in python2.4-2.4.4~/debian/PVER.postinst.in --- python2.4-2.4.4/debian/PVER.postinst.in 2007-11-28 22:44:25.000000000 +0100 +++ python2.4-2.4.4~/debian/PVER.postinst.in 2007-11-28 22:39:39.000000000 +0100 @@ -9,8 +9,7 @@ if [ "$1" = configure ]; then ( - cd /usr/lib/@PVER@ - files=$(dpkg -L @PVER@ | sed -n '/\.py$/s,^/usr/lib/@PVER@/,,p') + files=$(dpkg -L @PVER@ | sed -n '/^\/usr\/lib\/@[EMAIL PROTECTED]/.*\.py$/p') /usr/bin/@PVER@ /usr/lib/@PVER@/py_compile.py $files if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then /usr/bin/@PVER@ -O /usr/lib/@PVER@/py_compile.py $files