New submission from astronouth7303:
Something about distutils/cmd.py breaks inspect.findsource(). I am
unsure if this is a bug with DistUtils or the inspect module.
import inspect, distutils.cmd
inspect.findsource(distutils.cmd.install_misc.get_outputs)
Causes findsource() to receive an
Raghuram Devarakonda added the comment:
I can't reproduce it with 2.5.1 on SuSE 10. Can you please report the
exact traceback you see?
--
nosy: +draghuram
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1728
__
astronouth7303 added the comment:
sqlite3/test/types.py also seems to cause the same error, although the
difference is much wider (101 lines vs. 351).
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1728
__
astronouth7303 added the comment:
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
Guido van Rossum added the comment:
Can't repro either.
I strongly suspect that this is because somehow linecache finds a
different version of the module on sys.path.
--
nosy: +gvanrossum
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1728
astronouth7303 added the comment:
Indeed. For the distutils.cmd case, linecache.updatecache() takes
cmd.py and tracks that down to /usr/lib/python2.5/cmd.py. This would
also explain the sqlite3.tests.types problem.
The bug seems to be that the inspect module doesn't pass enough context
Guido van Rossum added the comment:
Can you trace this a bit further? Can you suggest a specific
modification that would fix this issue?
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1728
__
Raghuram Devarakonda added the comment:
When I printed the file name that is being passed to
linecache.getlines() by findsource(), the file name is absolute path.
So there may be nothing wrong with linecache itself. Can you see what
is the name being passed in your case? We still need to trace
Jamie Bliss added the comment:
depending on the use case, updatecache() will be passed
'distutils/cmd.py', but still turn that into '/usr/lib/python2.5/cmd.py'.
I have not messed with my stock Python modules. My sys.path is:
* /usr/lib/python2.5/site-packages/recaptcha_client-1.0.1-py2.5.egg
*
Christian Heimes added the comment:
The issue is probably related to http://bugs.python.org/issue1665
--
nosy: +tiran
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1728
__
Guido van Rossum added the comment:
Do you happen to be on Ubuntu?
Maybe this is the same as issue #1665 ?
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1728
__
___
Jamie Bliss added the comment:
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.)
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1728
Changes by Guido van Rossum:
--
resolution: - duplicate
status: open - closed
superseder: - re.match.func_code.co_filename returns re.py
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1728
__
13 matches
Mail list logo