[Python-checkins] cpython: Issue #20376: Argument Clinic now escapes backslashes in docstrings.

zach.ware python-checkins at python.org
Sat Jan 25 10:26:34 CET 2014


http://hg.python.org/cpython/rev/381c9d592cc8
changeset:   88685:381c9d592cc8
user:        Zachary Ware <zachary.ware at gmail.com>
date:        Sat Jan 25 03:26:20 2014 -0600
summary:
  Issue #20376: Argument Clinic now escapes backslashes in docstrings.

files:
  Misc/NEWS              |  2 ++
  Tools/clinic/clinic.py |  1 +
  2 files changed, 3 insertions(+), 0 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -142,6 +142,8 @@
 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
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -120,6 +120,7 @@
 
 def quoted_for_c_string(s):
     for old, new in (
+        ('\\', '\\\\'), # must be first!
         ('"', '\\"'),
         ("'", "\\'"),
         ):

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list