This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2009年12月30日 23:16 by alexandre.vassalotti, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (1) | |||
|---|---|---|---|
| msg97067 - (view) | Author: Alexandre Vassalotti (alexandre.vassalotti) * (Python committer) | Date: 2009年12月30日 23:16 | |
It seems PyUnicode_FromFormatV wrongly assumes that the return value of
PyObject_Str and PyObject_Repr is a unicode object. It looks like the
%S and %R feature was backported from 3.x without updating the code for 2.x.
PyObject *
PyUnicode_FromFormatV(const char *format, va_list vargs)
{
...
case 'S':
{
PyObject *obj = va_arg(count, PyObject *);
PyObject *str;
assert(obj);
str = PyObject_Str(obj);
if (!str)
goto fail;
n += PyUnicode_GET_SIZE(str);
/* Remember the str and switch to the next slot */
*callresult++ = str;
break;
}
case 'R':
{
PyObject *obj = va_arg(count, PyObject *);
PyObject *repr;
assert(obj);
repr = PyObject_Repr(obj);
if (!repr)
goto fail;
n += PyUnicode_GET_SIZE(repr);
/* Remember the repr and switch to the next slot */
*callresult++ = repr;
break;
}
...
}
|
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:55 | admin | set | github: 51857 |
| 2009年12月30日 23:20:38 | alexandre.vassalotti | set | stage: test needed -> resolved |
| 2009年12月30日 23:20:18 | alexandre.vassalotti | set | status: open -> closed resolution: duplicate superseder: PyUnicode_FromFormat broken and not documented for 2.x |
| 2009年12月30日 23:16:53 | alexandre.vassalotti | create | |