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.
Created on 2007年12月19日 22:55 by thekorn, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (9) | |||
|---|---|---|---|
| msg58838 - (view) | Author: Markus Korn (thekorn) | Date: 2007年12月19日 23:02 | |
re.match.func_code.co_filename returns "re.py" I expect something like "/usr/lib/python2.5/re.py" This causes issues in the "inspect"-module like: >>> inspect.getabsfile(re.match) >>> '<current-dir>/re.py' Sorry, this is my first python-bugreport, please ping me if you need any further details. Markus |
|||
| msg58840 - (view) | Author: Guido van Rossum (gvanrossum) * (Python committer) | Date: 2007年12月19日 23:05 | |
I can't reproduce this. How did you install Python? Python 2.5.2a0 (release25-maint, Nov 27 2007, 14:00:00) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import re >>> re.match.func_code.co_filename '/usr/local/lib/python2.5/re.py' >>> |
|||
| msg58841 - (view) | Author: Markus Korn (thekorn) | Date: 2007年12月19日 23:13 | |
Thanks for your fast reply. I'm using the python package of ubuntu-feisty, $ python Python 2.5.1 (r251:54863, Oct 5 2007, 13:50:07) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import re >>> re.match.func_code.co_filename 're.py' >>> So maybe it's ubuntu-specific!? |
|||
| msg58845 - (view) | Author: Guido van Rossum (gvanrossum) * (Python committer) | Date: 2007年12月19日 23:55 | |
Then I suggest you talk to the Ubuntu developers or whoever packaged Python 2.5.1 for it. |
|||
| msg58855 - (view) | Author: Christian Heimes (christian.heimes) * (Python committer) | Date: 2007年12月20日 05:00 | |
I'm able to reproduce the problem on Ubuntu. It's probably caused by their compile step in python2.5.postinst: cd /usr/lib/python2.5 files=$(dpkg -L python2.5 | sed -n '/\.py$/s,^/usr/lib/python2.5/,,p') /usr/bin/python2.5 /usr/lib/python2.5/py_compile.py $files if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then /usr/bin/python2.5 -O /usr/lib/python2.5/py_compile.py $files fi It's compiling the py files relative to /usr/lib/python2.5. Please note that the behavior of py_compile.py is intended. The relative path is useful for people who pack the compiled files into a zip file or egg file. |
|||
| msg58856 - (view) | Author: Guido van Rossum (gvanrossum) * (Python committer) | Date: 2007年12月20日 05:12 | |
Well, if they do that, they apparently break inspect.py. Should they be doing that? Why are they doing that? Can you contact the Ubuntu folks about this? |
|||
| msg58861 - (view) | Author: Christian Heimes (christian.heimes) * (Python committer) | Date: 2007年12月20日 05:58 | |
Guido van Rossum wrote: > Guido van Rossum added the comment: > > Well, if they do that, they apparently break inspect.py. Should they > be doing that? Why are they doing that? Can you contact the Ubuntu > folks about this? No, they shouldn't. It may be plain ignorance or they have a hidden agenda. I'm going to contact the Debian maintainers. I'm sure the Ubuntu guys have copied the behavior from Debian. Christian |
|||
| msg58863 - (view) | Author: Christian Heimes (christian.heimes) * (Python committer) | Date: 2007年12月20日 06:13 | |
I proposed to the maintainer that he should change one line to dpkg -L python2.5 | sed -n '/\.py$/p' In the mean time you can easily fix the issue with: sudo find /usr/lib/python2.5 -name '*.py[co]' -delete sudo python2.5 /usr/lib/python2.5/compileall.py /usr/lib/python2.5/ sudo python2.5 -O /usr/lib/python2.5/compileall.py /usr/lib/python2.5/ |
|||
| msg58915 - (view) | Author: Markus Korn (thekorn) | Date: 2007年12月20日 18:42 | |
Thanks a lot, this works. Markus |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:29 | admin | set | github: 46006 |
| 2008年01月04日 01:11:43 | gvanrossum | link | issue1728 superseder |
| 2007年12月20日 18:42:23 | thekorn | set | messages: + msg58915 |
| 2007年12月20日 13:43:40 | georg.brandl | set | status: pending -> closed versions: + 3rd party, - Python 2.5 |
| 2007年12月20日 06:13:57 | christian.heimes | set | messages: + msg58863 |
| 2007年12月20日 05:58:18 | christian.heimes | set | messages: + msg58861 |
| 2007年12月20日 05:12:06 | gvanrossum | set | messages: + msg58856 |
| 2007年12月20日 05:00:12 | christian.heimes | set | status: open -> pending nosy: + christian.heimes resolution: works for me messages: + msg58855 |
| 2007年12月19日 23:55:14 | gvanrossum | set | messages: + msg58845 |
| 2007年12月19日 23:13:59 | thekorn | set | messages: + msg58841 |
| 2007年12月19日 23:05:51 | gvanrossum | set | nosy:
+ gvanrossum messages: + msg58840 |
| 2007年12月19日 23:02:13 | thekorn | set | messages: + msg58838 |
| 2007年12月19日 22:55:20 | thekorn | create | |