[Python-checkins] gh-80282: Argument Clinic: Add clarifying comment about ASCII docstring limitation (#107764)

erlend-aasland webhook-mailer at python.org
Wed Aug 9 01:55:39 EDT 2023


https://github.com/python/cpython/commit/925bbc2166d169962210314772d13270e9ba60a2
commit: 925bbc2166d169962210314772d13270e9ba60a2
branch: main
author: Erlend E. Aasland <erlend at python.org>
committer: erlend-aasland <erlend.aasland at protonmail.com>
date: 2023-08-09T07:55:34+02:00
summary:

gh-80282: Argument Clinic: Add clarifying comment about ASCII docstring limitation (#107764)

Co-authored-by: Alex Waygood <Alex.Waygood at Gmail.com>

files:
M Tools/clinic/clinic.py

diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
index 16f31717080e1..059c2db27288d 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -5461,6 +5461,11 @@ def state_parameter_docstring_start(self, line: str) -> None:
 
     def docstring_append(self, obj: Function | Parameter, line: str) -> None:
         """Add a rstripped line to the current docstring."""
+        # gh-80282: We filter out non-ASCII characters from the docstring,
+        # since historically, some compilers may balk on non-ASCII input.
+        # If you're using Argument Clinic in an external project,
+        # you may not need to support the same array of platforms as CPython,
+        # so you may be able to remove this restriction.
         matches = re.finditer(r'[^\x00-\x7F]', line)
         if offending := ", ".join([repr(m[0]) for m in matches]):
             warn("Non-ascii characters are not allowed in docstrings:",



More information about the Python-checkins mailing list