Issue #3782: os.write() must not accept unicode strings

This commit is contained in:
Antoine Pitrou 2008-09-15 23:02:56 +00:00
parent 4e80cdd739
commit 9cadb1b6e0
9 changed files with 50 additions and 24 deletions

View file

@ -4896,7 +4896,7 @@ posix_write(PyObject *self, PyObject *args)
int fd;
Py_ssize_t size;
if (!PyArg_ParseTuple(args, "is*:write", &fd, &pbuf))
if (!PyArg_ParseTuple(args, "iy*:write", &fd, &pbuf))
return NULL;
Py_BEGIN_ALLOW_THREADS
size = write(fd, pbuf.buf, (size_t)pbuf.len);