Author ocean-city
Recipients
Date 2006-05-26.21:18:00
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=1200846

>The change to PyUnicode_Resize() should be reverted (or done
>in a way that doesn't lead to bugs).

Sorry, how about this?

Index: Objects/unicodeobject.c
===================================================================
--- Objects/unicodeobject.c	(revision 46417)
+++ Objects/unicodeobject.c	(working copy)
@@ -326,7 +326,7 @@
 	return -1;
     }
     v = (PyUnicodeObject *)*unicode;
-    if (v == NULL || !PyUnicode_Check(v) || v->ob_refcnt !=
1 || length < 0) {
+    if (v == NULL || !PyUnicode_Check(v) || length < 0) {
 	PyErr_BadInternalCall();
 	return -1;
     }
@@ -335,7 +335,7 @@
        possible since these are being shared. We simply
return a fresh
        copy with the same Unicode content. */
     if (v->length != length &&
-	(v == unicode_empty || v->length == 1)) {
+	(v == unicode_empty || v->length == 1 || v->ob_refcnt != 1)) {
 	PyUnicodeObject *w = _PyUnicode_New(length);
 	if (w == NULL)
 	    return -1;
History
Date User Action Args
2007-08-23 15:47:12adminlinkissue1455898 messages
2007-08-23 15:47:12admincreate