Skip to content

Commit 925bbc2

Browse files
gh-80282: Argument Clinic: Add clarifying comment about ASCII docstring limitation (#107764)
Co-authored-by: Alex Waygood <[email protected]>
1 parent 7b6e34e commit 925bbc2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Tools/clinic/clinic.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5461,6 +5461,11 @@ def state_parameter_docstring_start(self, line: str) -> None:
54615461

54625462
def docstring_append(self, obj: Function | Parameter, line: str) -> None:
54635463
"""Add a rstripped line to the current docstring."""
5464+
# gh-80282: We filter out non-ASCII characters from the docstring,
5465+
# since historically, some compilers may balk on non-ASCII input.
5466+
# If you're using Argument Clinic in an external project,
5467+
# you may not need to support the same array of platforms as CPython,
5468+
# so you may be able to remove this restriction.
54645469
matches = re.finditer(r'[^\x00-\x7F]', line)
54655470
if offending := ", ".join([repr(m[0]) for m in matches]):
54665471
warn("Non-ascii characters are not allowed in docstrings:",

0 commit comments

Comments
 (0)