summaryrefslogtreecommitdiffstats
path: root/Modules/_io/textio.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-12-13 19:19:07 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-12-13 19:19:07 (GMT)
commitddd392cbb9a94355a2ea32da4a42371d1333bfb8 (patch)
treef4c325ef0ec20e0e2007770992d371baa07c2bc7 /Modules/_io/textio.c
parente304852e21a92ef0a74c2d85c070572fddb4fba8 (diff)
downloadcpython-ddd392cbb9a94355a2ea32da4a42371d1333bfb8.zip
cpython-ddd392cbb9a94355a2ea32da4a42371d1333bfb8.tar.gz
cpython-ddd392cbb9a94355a2ea32da4a42371d1333bfb8.tar.bz2
accept None as the same as having passed no argument in file types #7349
This is for consistency with imitation file objects like StringIO and BytesIO. This commit also adds a few tests, where they were lacking for concerned methods.
Diffstat (limited to 'Modules/_io/textio.c')
-rw-r--r--Modules/_io/textio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index 2f99a60..91fecae 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -1455,7 +1455,7 @@ textiowrapper_read(textio *self, PyObject *args)
CHECK_INITIALIZED(self);
- if (!PyArg_ParseTuple(args, "|n:read", &n))
+ if (!PyArg_ParseTuple(args, "|O&:read", &_PyIO_ConvertSsize_t, &n))
return NULL;
CHECK_CLOSED(self);