[issue9325] Add an option to pdb/trace/profile to run library module as a script

2018-01-11 Thread Alexander Belopolsky
Change by Alexander Belopolsky : -- assignee: belopolsky -> ___ Python tracker ___

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2018-01-10 Thread Nick Coghlan
Nick Coghlan added the comment: While I do think it makes sense to enhance `dis` in this regard, I'm also thinking it might be better to have that automatically fall back to a `python -m inspect module:qualname` style lookup in the event that `os.path.exists(infile)` is

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2018-01-10 Thread Mario Corchero
Mario Corchero added the comment: Thanks Nick. I've sent patches for all of them but `dis`. `dis` does not "run" the code. Adding the -m option is basically identical to just running it on the __main__.py if the module is runnable or on the __init__ if it is not. If you

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2018-01-07 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks. I've added the dependencies, and also granted you triage permissions on the tracker, so you should be able to edit dependencies yourself in the future. -- dependencies: +Add an option to profile to run library module as a

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2018-01-07 Thread Mario Corchero
Mario Corchero added the comment: Just finished a draft on the one for trace: issue32515 -- ___ Python tracker ___

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2018-01-07 Thread Mario Corchero
Mario Corchero added the comment: I've created an issue + PR for profile which basically ports the change in cProfile: issue32512 I am not able to add it as a dependency on this one (rights issue probably). -- ___ Python

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2018-01-07 Thread Nick Coghlan
Nick Coghlan added the comment: +1 for creating separate issues and linking them from this one - while the risk of breaking anything seems low, if we do cause a regression, multiple issues and PRs provide better traceability than one giant issue for everything. (I'm also

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2018-01-06 Thread Mario Corchero
Mario Corchero added the comment: pdb and cProfile are covered. If no one is working on it, do you want me try to put through a patch for "profile" and "trace"? Should I create a separate issue if so? >From Issue 17473 it will leave only: doctest: Which might be

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2018-01-04 Thread Nick Coghlan
Nick Coghlan added the comment: Issue 32206 covers doing this for `pdb`. It relies on directly accessing private APIs in the `runpy` module, but we can live with that, since `pdb` is part of the standard library. -- dependencies: +Run modules with pdb, cProfile

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2017-11-06 Thread Nick Coghlan
Nick Coghlan added the comment: Issue 21862 is a related issue specifically for the cProfile module. In that case, cProfile's command line invocation *doesn't* use the main module, so the patch is able to just create a synthetic call to runpy.run_module as a string and

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2017-07-29 Thread Segev Finer
Changes by Segev Finer : -- nosy: +Segev Finer ___ Python tracker ___ ___ Python-bugs-list

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2016-02-22 Thread Piotr Dobrogost
Changes by Piotr Dobrogost : -- nosy: +piotr.dobrogost ___ Python tracker ___

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2014-07-12 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: -berker.peksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9325 ___ ___

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2013-12-17 Thread Nick Coghlan
Nick Coghlan added the comment: Issue 19982 suggests a different way of refactoring the runpy APIs inspired by PEP 451: passing in a target module to be used, rather than creating a temporary one from scratch. -- ___ Python tracker

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2013-09-27 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +berker.peksag versions: +Python 3.4 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9325 ___

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2013-09-26 Thread Nick Coghlan
Nick Coghlan added the comment: Issue 17473 had a longer list of relevant modules: pdb profile doctest trace modulefinder tabnanny pyclbr dis -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9325

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2013-09-26 Thread Nick Coghlan
Nick Coghlan added the comment: Also, the ModuleSpec PEP (PEP 451)should make the proposed refactoring much simpler, since the code runner could just expose data from the module spec. -- ___ Python tracker rep...@bugs.python.org

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2013-09-26 Thread Eric Snow
Eric Snow added the comment: Soon, my precious, soon... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9325 ___ ___ Python-bugs-list mailing

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2012-11-12 Thread Eric Snow
Changes by Eric Snow ericsnowcurren...@gmail.com: -- nosy: +eric.snow ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9325 ___ ___ Python-bugs-list

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2012-07-14 Thread Eli Bendersky
Changes by Eli Bendersky eli...@gmail.com: -- nosy: -eli.bendersky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9325 ___ ___ Python-bugs-list

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2011-04-23 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9325 ___

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2011-04-22 Thread Greg Słodkowicz
Greg Słodkowicz jerg...@gmail.com added the comment: Thanks, Nick. Before your last comment, I haven't looked much into Pdb, instead focusing on profile.py and trace.py because they looked like simpler cases. I think the approach with CodeRunner objects would work just fine for profile and

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2011-04-15 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Good point about the extra parameter just pushing the problem one layer up the stack rather than completely solving the problem. However, on further reflection, I've realised that I really don't like having runpy import the threading module

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2011-04-10 Thread Greg Słodkowicz
Greg Słodkowicz jerg...@gmail.com added the comment: Following Nick's advice, I extended runpy.run_module to accept an extra parameter to be used as replacement __main__ namespace. Having this, I can make this temporary __main__ accessible in main() in modules like trace/profile/pdb even if

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2011-04-01 Thread Greg Słodkowicz
Changes by Greg Słodkowicz jerg...@gmail.com: -- nosy: +Greg.Slodkowicz ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9325 ___ ___

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2010-10-06 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9325 ___ ___

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2010-10-05 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: I am afraid, for ordinary scripts these modules effectively use option 3. I think these modules should remove its own scaffolding from real __main__ before loading any traced code. I am not sure how this can be

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2010-10-05 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: On Wed, Oct 6, 2010 at 2:59 AM, Alexander Belopolsky rep...@bugs.python.org wrote: Alexander Belopolsky belopol...@users.sourceforge.net added the comment: I am afraid, for ordinary scripts these modules effectively use option 3.  I think

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2010-09-21 Thread Alexander Belopolsky
Changes by Alexander Belopolsky belopol...@users.sourceforge.net: -- nosy: +ncoghlan, terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9325 ___

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2010-09-21 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I've thought about this in the past, but never really pursued it due to the question of what to do with the __main__ namespace. There are three options here: 1. Use runpy.run_module to run the module in a fresh __main__ namespace 2. Use

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2010-07-30 Thread Alexander Belopolsky
Changes by Alexander Belopolsky belopol...@users.sourceforge.net: -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9325 ___

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2010-07-21 Thread Alexander Belopolsky
New submission from Alexander Belopolsky belopol...@users.sourceforge.net: The -m interpreter option allows one to run library module as a script, but if you want to debug, profile or trace the execution of the same, you must supply the path to the module source file on the command line. The

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2010-07-21 Thread Alexander Belopolsky
Changes by Alexander Belopolsky belopol...@users.sourceforge.net: -- nosy: +eli.bendersky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9325 ___