Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#11 tracing fails on python 2.4

closed-works-for-me
5
2007-03-05
2007-03-04
No

Such simple python file fails to be traced on python 2.4.4 if --threading used:
# cat a.py
import logging, logging.handlers
# pydb --trace --threading a.py
Current thread is MainThread
(<string>:1):
Current thread is MainThread
(<string>:1):
Current thread is MainThread
(/root/agserver/a.py:1):
1 import logging, logging.handlers
Current thread is MainThread
(/root/agserver/a.py:1):
1 import logging, logging.handlers
Traceback (most recent call last):
File "/usr/bin/pydb", line 647, in main
p._runscript(mainpyfile)
File "/usr/share/python2.4/site-packages/pydb/threaddbg.py", line 731, in _runscript
File "/usr/share/python2.4/site-packages/pydb/pydbbdb.py", line 301, in run
File "<string>", line 1, in ?
File "a.py", line 1, in ?
import logging, logging.handlers
File "/usr/share/python2.4/logging/__init__.py", line 27, in ?
File "/usr/share/python2.4/site-packages/pydb/gdb.py", line 232, in trace_dispatch_gdb
File "/usr/share/python2.4/site-packages/pydb/threaddbg.py", line 619, in trace_dispatch
File "/usr/share/python2.4/inspect.py", line 768, in getframeinfo
File "/usr/share/python2.4/inspect.py", line 437, in findsource
IndexError: list index out of range
*** Uncaught exception.
#

Seems to be working with python 2.5.

Discussion

  • Logged In: YES
    user_id=139606
    Originator: YES

    Forgot to mention: pydb 1.21

     
    • assigned_to: nobody --> rockyb
    • status: open --> closed-works-for-me
     
  • Logged In: YES
    user_id=158581
    Originator: NO

    Works for me in Python 2.4.2 (and also as you note 2.5). So what version of Python are you using?

    Also the traceback you give seems to indicate an *unexpected* error in inspect.py. (The docstring says it can return an IOError.) I've put a try/except around the code anyway.

     
  • Logged In: YES
    user_id=139606
    Originator: YES

    As I wrote already in the body: python 2.4.4 :-)