mirror of
https://github.com/python/cpython.git
synced 2025-09-11 11:17:16 +00: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:
parent
e7d8be80ba
commit
39fd672dfe
3 changed files with 7 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue