Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: I am not sure whether it is appropriate to comment on a closed issue, but if the tracker will take this comment, hopefully it will find the right audience.
I have recently stumbled on this bug running python 2.5. While tracking the problem down, I've noticed that some of the script running logic in pdb and runpy is replicated in some aspects and slightly different in others. Thus both pdb and runpy pop sys.argv[0], but (after this patch) pdb cleans __main__.__dict__ and repopulates it by executing the script while runpy replaces sys.modules['__main__'] with a fresh module and uses that module's namespace to run the script in. Furthemore, runpy injects __loader__ in the "main" namespace while pdb does not. While I cannot point out any specific problems (other than inability to debug applications in zipped packages with python -m pdb app.zip), I believe pdb should use the same logic and preferably the same code as runpy. Finally a nit: why does _runscript use run("execfile(filename)") instead of runcall(execfile, filename, gloabals_, locals_)? ---------- nosy: +belopolsky _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1429539> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com