summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
authorMarc-André Lemburg <mal@egenix.com>2001-11-20 15:18:49 (GMT)
committerMarc-André Lemburg <mal@egenix.com>2001-11-20 15:18:49 (GMT)
commit72f8213ba4b960bdf540a1cc494ac699170c9dec (patch)
tree0d1b57a65d1b91b86e525591c8654fa5ab41ae33 /Objects/unicodeobject.c
parent0c4d8d05a8b10c8c611eae0fbe70898050f12ad4 (diff)
downloadcpython-72f8213ba4b960bdf540a1cc494ac699170c9dec.zip
cpython-72f8213ba4b960bdf540a1cc494ac699170c9dec.tar.gz
cpython-72f8213ba4b960bdf540a1cc494ac699170c9dec.tar.bz2
Fix for bug #438164: %-formatting using Unicode objects.
This patch also does away with an incompatibility between Jython and CPython.
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 57ef62a..1420455 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -5300,6 +5300,7 @@ PyObject *PyUnicode_Format(PyObject *format,
"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 @@ PyObject *PyUnicode_Format(PyObject *format,
key = PyUnicode_EncodeUTF8(keystart,
keylen,
NULL);
+#else
+ key = PyUnicode_FromUnicode(keystart, keylen);
+#endif
if (key == NULL)
goto onError;
if (args_owned) {