You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linking back to the overall RFE for improved executable module support for standard library modules that run other scripts: https://bugs.python.org/issue9325
Thanks for creating this functionality. I'm so excited to use it that I've published a backport [https://pypi.org/project/backports.pdb], which seems to work for at least the basic use cases on Python 2.7+.
Adopting the backport, I believe I've found a defect. I filed the defect with the backport as backports.pdb 1.
Essentially, the issue is that __package__ gets set to the module name instead of the package name, causing issues with from .mod imports.
Feel free to take the relevant parts of the fix in the backport to adjust the implementation here, and definitely let me know if you think the adjustment I've made is somehow incorrect.
Full disclosure, I have not tested the canonical implementation in Python 3.7, only the backport in Python 3.6 and 2.7.
Please let me know if you would like me to file a separate issue.
mariocj89 commented on Jan 27, 2018
mariocj89mannequin
MannequinAuthor
More actions
Hi Jason, thanks a lot!
I’ll have a look to the bug you reported on Monday. Out for holidays atm ^^
I checked the original PR, and I'm pretty sure the reference implementation is going to have the same bug.
To keep the NEWS entries clear (since the buggy implementation already shipped in the alpha releases), I've created a new issue here: https://bugs.python.org/issue32691
Activity
mariocj89 commentedon Dec 3, 2017
Since PEP-338 we can run python modules as a script via
python -m module_namebut there is no way to run pdb on those (AFAIK).The proposal is to add a new argument "-m" to the pdb module to allow users to run
python -m pdb -m my_module_nameThis is especially useful when working on cli tools that use entrypoints in setup.py, as there is no other way to run them.
I have a WIP here: mariocj89@f47d1b7
Haven't sent the PR as I am still polishing some issues. If it sounds like a good idea I'll clean it up and open the PR.
ncoghlan commentedon Jan 5, 2018
Linking back to the overall RFE for improved executable module support for standard library modules that run other scripts: https://bugs.python.org/issue9325
ncoghlan commentedon Jan 6, 2018
New changeset 9f1e5f1 by Nick Coghlan (Mario Corchero) in branch 'master':
bpo-32206: Pdb can now run modules (GH-4752)
9f1e5f1
ncoghlan commentedon Jan 6, 2018
Thanks for the patch!
ncoghlan commentedon Jan 6, 2018
Re-opening for the CLI help updates.
jaraco commentedon Jan 26, 2018
Thanks for creating this functionality. I'm so excited to use it that I've published a backport [https://pypi.org/project/backports.pdb], which seems to work for at least the basic use cases on Python 2.7+.
jaraco commentedon Jan 27, 2018
Adopting the backport, I believe I've found a defect. I filed the defect with the backport as backports.pdb 1.
Essentially, the issue is that
__package__gets set to the module name instead of the package name, causing issues withfrom .modimports.Feel free to take the relevant parts of the fix in the backport to adjust the implementation here, and definitely let me know if you think the adjustment I've made is somehow incorrect.
Full disclosure, I have not tested the canonical implementation in Python 3.7, only the backport in Python 3.6 and 2.7.
Please let me know if you would like me to file a separate issue.
mariocj89 commentedon Jan 27, 2018
Hi Jason, thanks a lot!
I’ll have a look to the bug you reported on Monday. Out for holidays atm ^^
ncoghlan commentedon Jan 28, 2018
New changeset fcf8b4c by Nick Coghlan (Mario Corchero) in branch 'master':
bpo-32206: Update pdb usage to include new module option (GH-5111)
fcf8b4c
ncoghlan commentedon Jan 28, 2018
I checked the original PR, and I'm pretty sure the reference implementation is going to have the same bug.
To keep the NEWS entries clear (since the buggy implementation already shipped in the alpha releases), I've created a new issue here: https://bugs.python.org/issue32691