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
The meaning of "python3 -m pdb" is slowly going wild on short input files? Step-by-step evolving now with no tests deployed to limit how wild it goes?
Four Notes here = Two wrongs we can repro simply, and then two bits of more context
1 )
The process exit return code wrongly comes back as zero in reply to Syntax-Error's, not the nonzero that used to screen out Syntax-Error's, when I upgrade to Python 13 from 12
For example, this M Pdb test of a short SyntaxError
But in Python 3.13, this same empty test now produces infinitely many copies of a log line, and hangs until you press Control + \
$ echo |python3.13 -m pdb /dev/null
The program finished and will be restarted
The program finished and will be restarted
...
The effects of pressing Control + C instead are not simple. In some Python's, you get multiple chances to press Control + C. In others, it works only the first time. Sometimes Control + D will exit the process after a Control + C. Sometimes it won't. Here I'm reporting from my own living human memory, I've not written out a carefully reproducible survey of all that
"We like the old result much better, yes?"
3 )
I saw these bugs first in macOS, where I take the Python binary from Python Org as it comes out monthly
To make this report, I've gone and tested Linux too. For these bugs, I see that a Python Version gone wrong at macOS also goes wrong in the same way in the same Python Version at Linux. That's comforting
More specifically, I do also see these same bugs in the Linux Gcloud Gshell of my Gmail, after I toss in a few more Linux Python's from DeadSnakes for comparison
For the first issue, no I don't believe the old behavior is better. SyntaxError, like any other exceptions, is just an exception. The exit code of python -m pdb should be the status of pdb, not the script it's debugging. If your script raise a run-time exception, python -m pdb won't have a non-zero exit code. I don't believe raise ValueError() and raise SyntaxError should have different return code, or even different behavior to pdb.
For the second issue, it's a very rare case. I agree the result is not ideal and I'll look into it and see if we can make it better (at least not stuck in an infinite loop).
The infinite spam of empty file is fixed in #125425. As I mentioned above, I believe the exit code is actually more consistent than the previous result. So I'll close this for now, feel free to reopen it or open a new issue if you find other behavior that's not ideal.
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
The meaning of "python3 -m pdb" is slowly going wild on short input files? Step-by-step evolving now with no tests deployed to limit how wild it goes?
Four Notes here = Two wrongs we can repro simply, and then two bits of more context
1 )
The process exit return code wrongly comes back as zero in reply to Syntax-Error's, not the nonzero that used to screen out Syntax-Error's, when I upgrade to Python 13 from 12
For example, this M Pdb test of a short SyntaxError
produces the conflicting outputs
We like the old result much better, yes?
2 )
M Pdb tests hang in a loop producing infinite output, after the upgrade to Python 13 from 10
For example, this test of an empty Input File ran happy quickly and concisely, back in the days of 2021 Python 10
But in Python 3.13, this same empty test now produces infinitely many copies of a log line, and hangs until you press Control + \
The effects of pressing Control + C instead are not simple. In some Python's, you get multiple chances to press Control + C. In others, it works only the first time. Sometimes Control + D will exit the process after a Control + C. Sometimes it won't. Here I'm reporting from my own living human memory, I've not written out a carefully reproducible survey of all that
"We like the old result much better, yes?"
3 )
I saw these bugs first in macOS, where I take the Python binary from Python Org as it comes out monthly
To make this report, I've gone and tested Linux too. For these bugs, I see that a Python Version gone wrong at macOS also goes wrong in the same way in the same Python Version at Linux. That's comforting
More specifically, I do also see these same bugs in the Linux Gcloud Gshell of my Gmail, after I toss in a few more Linux Python's from DeadSnakes for comparison
I haven't tested Python3.10 at macOS myself
4 )
Thank you for believing I could help
Am I helping? Can I help more?
CPython versions tested on:
3.13
Operating systems tested on:
Linux, macOS
The text was updated successfully, but these errors were encountered: