New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
re.match.func_code.co_filename returns "re.py" #46006
Comments
re.match.func_code.co_filename returns "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 Markus |
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'
>>> |
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!? |
Then I suggest you talk to the Ubuntu developers or whoever packaged |
I'm able to reproduce the problem on Ubuntu. It's probably caused by
'/\.py$/s,^/usr/lib/python2.5/,,p') It's compiling the py files relative to /usr/lib/python2.5. Please note |
Well, if they do that, they apparently break inspect.py. Should they |
Guido van Rossum wrote:
No, they shouldn't. It may be plain ignorance or they have a hidden Christian |
I proposed to the maintainer that he should change one line to
In the mean time you can easily fix the issue with: sudo find /usr/lib/python2.5 -name '*.py[co]' -delete |
Thanks a lot, this works. Markus |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: