[issue9323] trace.py bug with the main file being traced

Eli Bendersky report at bugs.python.org
Sat Aug 7 08:50:55 CEST 2010


Eli Bendersky <eliben at gmail.com> added the comment:

Looking at Lib/test/regrtest.py:

  if __name__ == '__main__':
      # Simplification for findtestdir().
      assert __file__ == os.path.abspath(sys.argv[0])

I'm not sure regrtest.py is prepared to be run from trace at all. Note that this error also happens when running 'python -m profile regrtest.py', so it's rather regrtest.py specific than trace.py specific.

Anyway, trace.py itself currently passes the cmd-line argument as __file__ and not its full path, which causes the breakage in regrtest.py. The full path *could* be easily passed, but I think we should address this problem from regrtest.py's side.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9323>
_______________________________________


More information about the Python-bugs-list mailing list