gh-75261: Propogate use_rawinput to recursive pdb (debug command)#2947
gh-75261: Propogate use_rawinput to recursive pdb (debug command)#2947segevfiner wants to merge 5 commits intopython:mainfrom
Conversation
|
This looks like it might fix readline handling with recursive debugging, e.g. cursor keys being displayed as |
Maybe, if the underlying issue was that readline wasn't used in recursive debugging. Feel free to try. |
|
Yay! \o/ Tested with: def f():
pass
import pdb
pdb.set_trace()And then using |
|
@segevfiner |
Patch via python/cpython#2947 (bpo-31078). The test is a bit constructed I guess, but at least something.
Patch via python/cpython#2947 (bpo-31078). No test, since it appears to be hard to simulate cursor keys etc.
a67fdf5 to
a2aed1d
Compare
a2aed1d to
abdfb28
Compare
| self.error(traceback.format_exception_only(*exc_info)[-1].strip()) | ||
| return | ||
| p = Pdb(self.completekey, self.stdin, self.stdout) | ||
| p.use_rawinput = self.use_rawinput |
There was a problem hiding this comment.
Could have a comment that this is required because "stdout" is passed.
As for a test, you could inspect frames (similar to pdbpp/pdbpp#169), but not sure if that is really useful / worth it.
(I just came across this again, after having backported it to pdbpp not correctly before - and wrote a test then.. ;) ref)
Patch via python/cpython#2947 (bpo-31078). No test, since it appears to be hard to simulate cursor keys etc.
|
This PR is stale because it has been open for 30 days with no activity. |
|
Refreshed (Bot seems to bug out and leave the PR as |
|
This PR is stale because it has been open for 30 days with no activity. |
|
Spam to mark PR fresh... |
MaxwellDupre
left a comment
There was a problem hiding this comment.
Ran test_pdb:
Ran 57 tests in 8.767s
OK
Looks ok.
|
This PR is stale because it has been open for 30 days with no activity. |
|
This PR is stale because it has been open for 30 days with no activity. |
|
Bump No. 5 |
|
This PR is stale because it has been open for 30 days with no activity. |
|
Bump No. 6 |
|
This PR is stale because it has been open for 30 days with no activity. |
|
Bump No. 7 |
|
This PR is stale because it has been open for 30 days with no activity. |
|
Bump No. 8 |
iritkatriel
left a comment
There was a problem hiding this comment.
A functional change such as this should be committed with a unit test that fails without the change.
Unit tests are important to (1) prevent regression, and (2) clarify what is being changed.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
Closing and re-opening to retrigger CLA checks. Sorry for the noise. |
|
This PR is stale because it has been open for 30 days with no activity. |
This is caused by Lib/pdb.py:1096 which always passes our own current stdin and stdout, and this triggers the conditional in Lib/pdb.py:144-145.
self.stdinandself.stdoutare initialized tosys.stdinandsys.stdoutrespectively when not passed explicitly: Lib/cmd.py:87-94.See Also: ipython/ipython#10721
https://bugs.python.org/issue31078