From: Zachary Ware Date: Sat, 25 Jan 2014 09:26:20 +0000 (-0600) Subject: Issue #20376: Argument Clinic now escapes backslashes in docstrings. X-Git-Tag: v3.4.0b3~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9d7849f454dbda30b55de3922093b567ad662714;p=python Issue #20376: Argument Clinic now escapes backslashes in docstrings. --- diff --git a/Misc/NEWS b/Misc/NEWS index a8e251a1e7..c3e8e88889 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -142,6 +142,8 @@ Tests Tools/Demos ----------- +- Issue #20376: Argument Clinic now escapes backslashes in docstrings. + - Issue #20381: Argument Clinic now sanity checks the default argument when c_default is also specified, providing a nice failure message for disallowed values. diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index d33abaed2a..7f1b059e80 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -120,6 +120,7 @@ def fail(*args, filename=None, line_number=None): def quoted_for_c_string(s): for old, new in ( + ('\\', '\\\\'), # must be first! ('"', '\\"'), ("'", "\\'"), ):