Skip to content

Commit 58de1dd

Browse files
bpo-41525: Make the Python program help ASCII-only (GH-21836)
1 parent 594f0ce commit 58de1dd

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
@@ -46,7 +46,11 @@ def test_site_flag(self):
4646

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

5155
def test_version(self):
5256
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
@@ -83,7 +83,7 @@ static const char usage_3[] = "\
8383
cumulative time (including nested imports) and self time (excluding\n\
8484
nested imports). Note that its output may be broken in multi-threaded\n\
8585
application. Typical usage is python3 -X importtime -c 'import asyncio'\n\
86-
-X dev: enable CPython’s “development mode, introducing additional runtime\n\
86+
-X dev: enable CPython's \"development mode\", introducing additional runtime\n\
8787
checks which are too expensive to be enabled by default. Effect of the\n\
8888
developer mode:\n\
8989
* Add default warning filter, as -W default\n\

0 commit comments

Comments
 (0)