-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-90095: Make .pdbrc work properly and add some reasonable tests #110496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I'd really like to echo that this become included. I myself wanted to take a crack this and am excited to see a PR open for it. Defining commands in |
Co-authored-by: Irit Katriel <[email protected]>
Do we consider this as a bug @iritkatriel ? (backport?) |
Could backporting break working code? |
@iritkatriel thank you reviewing this and getting it merged. @gaogaotiantian thank you for taking up this implementation. |
|
|
I don't think so. This change only affects |
Thanks @gaogaotiantian for the PR, and @iritkatriel for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Thanks @gaogaotiantian for the PR, and @iritkatriel for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, @gaogaotiantian and @iritkatriel, I could not cleanly backport this to
|
Sorry, @gaogaotiantian and @iritkatriel, I could not cleanly backport this to
|
GH-116660 is a backport of this pull request to the 3.11 branch. |
…ble tests (pythonGH-110496) (cherry picked from commit 44f9a84) Co-authored-by: Tian Gao <[email protected]>
…ble tests (pythonGH-110496) (cherry picked from commit 44f9a84) Co-authored-by: Tian Gao <[email protected]>
GH-116661 is a backport of this pull request to the 3.12 branch. |
pdb -c
and.pdbrc
works in a very weird way now.cmd.Cmd
hascmdqueue
which is perfect for loading user defined commands yet we decided to make our own path to hack it. This makes the special commands likecommands
or;;
fail because they rely on somecmd.Cmd
mechanics.This PR utilizes
cmdqueue
(and fixed where it was used wrong) which fixed the problem mentioned in #90095. With this implementation, the commands in.pdbrc
and passed in with-c
are treated almost exactly the same as the commands the users type in.Two existing tests related to
.pdbrc
are removed as ... they were not testing they thought they were.test_read_pdbrc_with_ascii_encoding
simply does not make sense - it basically tests that system with ascii encoding can't print unicode - it has almost nothing to do with pdb. It has nothing to do with enforcing.pdbrc
to beutf-8
.test_readrc_kwarg
passes only because the commands in.pdbrc
does not execute - I don't understand what's the point of the test.Reasonable tests are added with the PR to test
.pdbrc
. The testing framework is improved a bit to make writing.pdbrc
tests easier.