diff Objects/unicodeobject.c @ 21028:3dfbbf42bf16 legacy-trunk

Fix for bug #438164: %-formatting using Unicode objects. This patch also does away with an incompatibility between Jython and CPython.
author Marc-André Lemburg <mal@egenix.com>
date Tue, 20 Nov 2001 15:18:49 +0000
parents 9058e49c6c57
children c9c4c523dcbf
line wrap: on
line diff
--- a/Objects/unicodeobject.c	Tue Nov 20 15:17:25 2001 +0000
+++ b/Objects/unicodeobject.c	Tue Nov 20 15:18:49 2001 +0000
@@ -5300,6 +5300,7 @@
 				    "incomplete format key");
 		    goto onError;
 		}
+#if 0
 		/* keys are converted to strings using UTF-8 and
 		   then looked up since Python uses strings to hold
 		   variables names etc. in its namespaces and we
@@ -5307,6 +5308,9 @@
 		key = PyUnicode_EncodeUTF8(keystart,
 					   keylen,
 					   NULL);
+#else
+		key = PyUnicode_FromUnicode(keystart, keylen);
+#endif
 		if (key == NULL)
 		    goto onError;
 		if (args_owned) {