]> granicus.if.org Git - python/commitdiff
Fixed bug #1459029 - unicode reprs were double-escaped.
authorAnthony Baxter <anthonybaxter@gmail.com>
Thu, 30 Mar 2006 10:53:17 +0000 (10:53 +0000)
committerAnthony Baxter <anthonybaxter@gmail.com>
Thu, 30 Mar 2006 10:53:17 +0000 (10:53 +0000)
Backed out an old patch from 2000.

Misc/NEWS
Objects/object.c

index 6a316ccf7cc89c40dd078566f2dfb8909235907a..e85fef17bf3b0a972d87d20641eb1a47818b4c6f 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,8 @@ What's New in Python 2.5 alpha 1?
 Core and builtins
 -----------------
 
+- Fixed bug #1459029 - unicode reprs were double-escaped.
+
 - Patch #1396919: The system scope threads are reenabled on FreeBSD
   5.4 and later versions.
 
index 3404c35a3255b3f1919d801e3ede319d78718918..63fb4fdfeff77bc43c42fd10d74022cffefa1681 100644 (file)
@@ -316,7 +316,7 @@ PyObject_Repr(PyObject *v)
 #ifdef Py_USING_UNICODE
                if (PyUnicode_Check(res)) {
                        PyObject* str;
-                       str = PyUnicode_AsUnicodeEscapeString(res);
+                       str = PyUnicode_AsEncodedString(res, NULL, NULL);
                        Py_DECREF(res);
                        if (str)
                                res = str;