Skip to content

Commit 9171dc2

Browse files
bpo-41525: Make the Python program help ASCII-only (GH-21836)
(cherry picked from commit 58de1dd) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent 68bc679 commit 9171dc2

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

Lib/test/test_cmd_line.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ def test_site_flag(self):
4444

4545
def test_usage(self):
4646
rc, out, err = assert_python_ok('-h')
47-
self.assertIn(b'usage', out)
47+
lines = out.splitlines()
48+
self.assertIn(b'usage', lines[0])
49+
# The first line contains the program name,
50+
# but the rest should be ASCII-only
51+
b''.join(lines[1:]).decode('ascii')
4852

4953
def test_version(self):
5054
version = ('Python %d.%d' % sys.version_info[:2]).encode("ascii")
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The output of ``python --help`` contains now only ASCII characters.

Misc/python.man

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ Set implementation specific option. The following options are available:
295295
nested imports). Note that its output may be broken in multi-threaded
296296
application. Typical usage is python3 -X importtime -c 'import asyncio'
297297

298-
-X dev: enable CPython’s “development mode, introducing additional runtime
298+
-X dev: enable CPython's "development mode", introducing additional runtime
299299
checks which are too expensive to be enabled by default. It will not be
300300
more verbose than the default if the code is correct: new warnings are
301301
only emitted when an issue is detected. Effect of the developer mode:

Python/initconfig.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static const char usage_3[] = "\
8080
cumulative time (including nested imports) and self time (excluding\n\
8181
nested imports). Note that its output may be broken in multi-threaded\n\
8282
application. Typical usage is python3 -X importtime -c 'import asyncio'\n\
83-
-X dev: enable CPython’s “development mode, introducing additional runtime\n\
83+
-X dev: enable CPython's \"development mode\", introducing additional runtime\n\
8484
checks which are too expensive to be enabled by default. Effect of the\n\
8585
developer mode:\n\
8686
* Add default warning filter, as -W default\n\

0 commit comments

Comments
 (0)