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
python -d creates lots of tokenizer messages #89725
Comments
python3.9 -d: Python 3.9.7 (default, Oct 21 2021, 20:51:19)
python3.10 -d: Python 3.10.0 (default, Oct 21 2021, 23:13:32) [GCC 7.5.0] on linux (not that in both cases a PYTHONINTERACTIVE script is loaded) Is that intended ? |
What's even worse is that those debug lines get written to stdout, not stderr. |
Yeah, those are expected in 3.10, but this should not appear in release versions (only on debug ones). Python -d is normally used to debug the parser: -d : turn on parser debugging output (for experts only, only works on |
Yes, I know that (at the moment) it's only documented to work in the parser, but since Py_DebugFlag is a general purpose flag, this use could easily be extended to other parts of the interpreter as well, e.g. for parsing the command line or instrumenting the interpreter to collect debug stats. In any case, thanks for the quick fix, Pablo. |
Thanks you for the catch! |
I had left a comment on Github about using stderr instead of stdout, to make the output more consistent (other parser error messages go to stderr). Note sure whether that's something you still want to change before closing the issue. |
Yeah, let me fix that in another PR |
Hi Pablo, I think you missed one instance: print_escape(stdout, tok->cur, tok->inp - tok->cur); Cheers |
Thanks, Pablo :-) |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: