diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-12-13 19:19:07 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-12-13 19:19:07 +0000 |
commit | 2a0f35957fbb45e948f7c24b338aceb92e1d725e (patch) | |
tree | 4c458a7fe872fa72112e59b7bd15c7d29096c994 /Modules/_io/fileio.c | |
parent | 7a6486c74d29d00fe9199f8d890e0a7195c3c0f1 (diff) | |
download | cpython-2a0f35957fbb45e948f7c24b338aceb92e1d725e.tar.gz |
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/fileio.c')
-rw-r--r-- | Modules/_io/fileio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index e98de9e69f..164fe5bc08 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -599,7 +599,7 @@ fileio_read(fileio *self, PyObject *args) if (!self->readable) return err_mode("reading"); - if (!PyArg_ParseTuple(args, "|n", &size)) + if (!PyArg_ParseTuple(args, "|O&", &_PyIO_ConvertSsize_t, &size)) return NULL; if (size < 0) { |