GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||
GeezerVison is showing github.com — gh-108791: Fix `pdb` CLI invalid argument handling by chgnrdv · Pull Request #108816 · python/cpython Conversation
|
|
I had to make changes in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…on into pdb-cli-fix-error-handling
| except Exception: | ||
| traceback.print_exc() | ||
| except Exception as e: | ||
| print(f"{type(e).__name__}: {e}") |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Can you make it something like
try: self._details except ... : # Something you expect print(f"{type(e).__name__}: {e}") except Exception: traceback.print_exc()
to leave the general case untouched.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Looking at the runpy._get_module_details source, ImportError seems to be the only type of exception that can be raised here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think the improvement is fine. The argument parser piece is a bit hacky, but I'm planning to convert that part to argparse anyway (getopt has not been updated for like 10 years) so it's okay.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hi @chgnrdv , as I updated pdb to use |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@gaogaotiantian, thanks for notice, I'll take a look tomorrow. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
LGTM, @iritkatriel could you take a look? Thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
LGTM. Should this be backported? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Rare case, but safe and backward compatible. I think it should be back-ported. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Agreed |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @chgnrdv for the PR, and @iritkatriel for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…8816) (cherry picked from commit 162213f) Co-authored-by: Radislav Chugunov <[email protected]>
|
GH-110915 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-110916 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…8816) (cherry picked from commit 162213f) Co-authored-by: Radislav Chugunov <[email protected]>
|
GH-111063 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-111064 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
pdb CLI doesn't handle incorrect arguments properly
There was an error while loading. Please reload this page.