@@ -5461,6 +5461,11 @@ def state_parameter_docstring_start(self, line: str) -> None:
|
5461 | 5461 | |
5462 | 5462 | def docstring_append(self, obj: Function | Parameter, line: str) -> None: |
5463 | 5463 | """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. |
5464 | 5469 | matches = re.finditer(r'[^\x00-\x7F]', line) |
5465 | 5470 | if offending := ", ".join([repr(m[0]) for m in matches]): |
5466 | 5471 | warn("Non-ascii characters are not allowed in docstrings:", |
|