]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41525: Make the Python program help ASCII-only (GH-21836)
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 9 Sep 2020 00:28:02 +0000 (03:28 +0300)
committerGitHub <noreply@github.com>
Wed, 9 Sep 2020 00:28:02 +0000 (01:28 +0100)
Lib/test/test_cmd_line.py
Misc/NEWS.d/next/Core and Builtins/2020-08-12-07-35-07.bpo-41525.d9q3XL.rst [new file with mode: 0644]
Misc/python.man
Python/initconfig.c

index 4794d446f08c79452dd5fe007b7496f94639d3f1..fa3329efa28b827cfe75d8f0e9792e81ddc6aecb 100644 (file)
@@ -46,7 +46,11 @@ class CmdLineTest(unittest.TestCase):
 
     def test_usage(self):
         rc, out, err = assert_python_ok('-h')
-        self.assertIn(b'usage', out)
+        lines = out.splitlines()
+        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')
 
     def test_version(self):
         version = ('Python %d.%d' % sys.version_info[:2]).encode("ascii")
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-08-12-07-35-07.bpo-41525.d9q3XL.rst b/Misc/NEWS.d/next/Core and Builtins/2020-08-12-07-35-07.bpo-41525.d9q3XL.rst
new file mode 100644 (file)
index 0000000..acc00f8
--- /dev/null
@@ -0,0 +1 @@
+The output of ``python --help`` contains now only ASCII characters.
index 74b2d72939eeb45960009954d706aa9afadd7972..225376574a26a96af7c568072184e96e1dfa7174 100644 (file)
@@ -291,7 +291,7 @@ Set implementation specific option. The following options are available:
         nested imports). Note that its output may be broken in multi-threaded
         application. Typical usage is python3 -X importtime -c 'import asyncio'
 
-    -X dev: enable CPython’s “development mode”, introducing additional runtime
+    -X dev: enable CPython's "development mode", introducing additional runtime
         checks which are too expensive to be enabled by default. It will not be
         more verbose than the default if the code is correct: new warnings are
         only emitted when an issue is detected. Effect of the developer mode:
index 64286763b621edf49d00f3dfb3e4294cf5a02262..38d64b63afcc9c1b47372aeae2256c78a08b8bc2 100644 (file)
@@ -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\
              checks which are too expensive to be enabled by default. Effect of the\n\
              developer mode:\n\
                 * Add default warning filter, as -W default\n\