Skip to content

Commit 11a82c7

Browse files
bpo-41525: Make the Python program help ASCII-only (GH-21836)
(cherry picked from commit 58de1dd) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent fd1c725 commit 11a82c7

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

Lib/test/test_cmd_line.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ def test_site_flag(self):
4545

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

5054
def test_version(self):
5155
version = ('Python %d.%d' % sys.version_info[:2]).encode("ascii")
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ Set implementation specific option. The following options are available:
291291
nested imports). Note that its output may be broken in multi-threaded
292292
application. Typical usage is python3 -X importtime -c 'import asyncio'
293293

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

Python/initconfig.c

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

0 commit comments

Comments
 (0)