mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +00:00
Fix for bug #438164: %-formatting using Unicode objects.
This patch also does away with an incompatibility between Jython and CPython.
This commit is contained in:
parent
0c4d8d05a8
commit
72f8213ba4
2 changed files with 5 additions and 4 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue