-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-41525: Make the Python program help ASCII-only #21836
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
self.assertIn(b'usage', lines[0]) | ||
# The first line contains the program name, | ||
# but the rest should be ASCII-only | ||
b''.join(lines[1:]).decode('ascii') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would decoding each line separately be faster?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, decoding one large string at once is faster.
@@ -83,7 +83,7 @@ static const char usage_3[] = "\ | |||
cumulative time (including nested imports) and self time (excluding\n\ | |||
nested imports). Note that its output may be broken in multi-threaded\n\ | |||
application. Typical usage is python3 -X importtime -c 'import asyncio'\n\ | |||
-X dev: enable CPython’s “development mode”, introducing additional runtime\n\ | |||
-X dev: enable CPython's \"development mode\", introducing additional runtime\n\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though conversion would be a different issue, I am curious whether there is any good reason to not use """ quotes for the string instead of "s and '\n\' and '"'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is C.
@serhiy-storchaka There is some problem with the CI and the last commit. I am going to push an amended commit (git commit --amend --noedit) to unblock the CI |
89b32d5
to
191d3b5
Compare
Thanks @serhiy-storchaka for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9. |
(cherry picked from commit 58de1dd) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-22162 is a backport of this pull request to the 3.9 branch. |
(cherry picked from commit 58de1dd) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-22163 is a backport of this pull request to the 3.8 branch. |
Thank you Pablo! |
https://bugs.python.org/issue41525