]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-80282: Argument Clinic: Add clarifying comment about ASCII docstring limitation...
authorErlend E. Aasland <erlend@python.org>
Wed, 9 Aug 2023 05:55:34 +0000 (07:55 +0200)
committerGitHub <noreply@github.com>
Wed, 9 Aug 2023 05:55:34 +0000 (07:55 +0200)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Tools/clinic/clinic.py

index 16f31717080e1f2f3281414cd743bd2409a2c8e2..059c2db27288dbbbd62d0304b8eaed668e0237a2 100755 (executable)
@@ -5461,6 +5461,11 @@ class DSLParser:
 
     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:",