mirror of
https://github.com/python/cpython.git
synced 2026-05-19 02:44:16 -04:00
#3479: unichr(2**32) used to return u'\x00'.
The argument was fetched in a long, but PyUnicode_FromOrdinal takes an int. (why doesn't gcc issue a truncation warning in this case?)
This commit is contained in:
@@ -394,9 +394,9 @@ Return a string of one character with ordinal i; 0 <= i < 256.");
|
||||
static PyObject *
|
||||
builtin_unichr(PyObject *self, PyObject *args)
|
||||
{
|
||||
long x;
|
||||
int x;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "l:unichr", &x))
|
||||
if (!PyArg_ParseTuple(args, "i:unichr", &x))
|
||||
return NULL;
|
||||
|
||||
return PyUnicode_FromOrdinal(x);
|
||||
|
||||
Reference in New Issue
Block a user