[issue12021] mmap.read requires an argument

Charles-François Natali report at bugs.python.org
Tue May 31 19:04:28 CEST 2011


Charles-François Natali <neologix at free.fr> added the comment:

> I noticed that RawIOBase.read, TextIOBase.read, etc also accept None as the
> argument, treating it as -1. Should this be implemented, too?
>

That's because of the _PyIO_ConvertSsize_t converter, which silently
converts None to -1.
There's probably a good reason for doing this in the _io module, but I
don't see any reason to do the same thing in the mmap module (apart
from being consistent, of course).
Antoine?

If the patch is fine as-is, I'd like to commit it.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12021>
_______________________________________


More information about the Python-bugs-list mailing list