Author: guido.van.rossum
Date: Tue Jul  3 16:52:23 2007
New Revision: 56158

Modified:
   python/branches/py3k-struni/Objects/stringobject.c
Log:
Fix a subtle bug in PyString_Repr().
The smartquote code was deciding whether to use ' or "
by inspecting the *output* area...


Modified: python/branches/py3k-struni/Objects/stringobject.c
==============================================================================
--- python/branches/py3k-struni/Objects/stringobject.c  (original)
+++ python/branches/py3k-struni/Objects/stringobject.c  Tue Jul  3 16:52:23 2007
@@ -854,8 +854,9 @@
                /* figure out which quote to use; single is preferred */
                quote = '\'';
                if (smartquotes) {
-                       Py_UNICODE *test;
-                       for (test = p; test < p+length; ++test) {
+                       char *test, *start;
+                       start = PyString_AS_STRING(op);
+                       for (test = start; test < start+length; ++test) {
                                if (*test == '"') {
                                        quote = '\''; /* switch back to single 
quote */
                                        goto decided;
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to