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
distutils.cmd breaks inspect #46069
Comments
Something about distutils/cmd.py breaks inspect.findsource(). I am
Causes findsource() to receive an IndexError. From some hacking, I've found that the root cause appears to be that This bug causes pydoc to break when it is pointed at distutils.cmd. This is on Ubuntu Gutsy, Python 2.5.1 |
I can't reproduce it with 2.5.1 on SuSE 10. Can you please report the |
sqlite3/test/types.py also seems to cause the same error, although the |
The exact traceback is as follows: >>> findsource(distutils.cmd.install_misc.get_outputs)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/inspect.py", line 510, in findsource
if pat.match(lines[lnum]): break
IndexError: list index out of range |
Can't repro either. I strongly suspect that this is because somehow linecache finds a |
Indeed. For the distutils.cmd case, linecache.updatecache() takes The bug seems to be that the inspect module doesn't pass enough context |
Can you trace this a bit further? Can you suggest a specific |
When I printed the file name that is being passed to |
depending on the use case, updatecache() will be passed I have not messed with my stock Python modules. My sys.path is:
I've also attached the script I used to discover the bug originally. |
The issue is probably related to http://bugs.python.org/issue1665 |
Do you happen to be on Ubuntu? Maybe this is the same as issue bpo-1665 ? |
They might be the same bug, with different manifestations. That bug is starting to get rather annoying. (At first, I thought it wasn't. Surprise, surprise.) |
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: