[issue12021] mmap.read requires an argument

2012-10-29 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12021 ___ ___ Python-bugs-list mailing list

[issue12021] mmap.read requires an argument

2011-06-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Patch looks good to me, thank you :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12021 ___

[issue12021] mmap.read requires an argument

2011-06-08 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset 964d0d65a2a9 by Charles-François Natali in branch 'default': Issue #12021: Make mmap's read() method argument optional. Patch by Petri http://hg.python.org/cpython/rev/964d0d65a2a9 -- nosy: +python-dev

[issue12021] mmap.read requires an argument

2011-06-08 Thread Charles-François Natali
Charles-François Natali neolo...@free.fr added the comment: Patch committed. Thanks for the report and the patch! -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue12021] mmap.read requires an argument

2011-06-07 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: It seems I did. Attached now for real :) -- Added file: http://bugs.python.org/file22275/mmap_read_all_4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12021

[issue12021] mmap.read requires an argument

2011-06-06 Thread Charles-François Natali
Charles-François Natali neolo...@free.fr added the comment: 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 I'm not sure about the original reason, but I find None as the default

[issue12021] mmap.read requires an argument

2011-06-06 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: If being pretty is the only reason for this choice, then I think that documenting the method as method:: read([n]) is simpler and cleaner . But you've got much more experience than me, so I won't argue any further :-) There are

[issue12021] mmap.read requires an argument

2011-06-06 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: I think duplicating it is fine, since the code is probably simple anyway Added a new patch. I duplicated the None converting logic in _io/_iomodule.c to mmapmodule.c, changed the doc to say read([n]), and expanded the test cases a bit.

[issue12021] mmap.read requires an argument

2011-06-06 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Didn't you forget to attach the patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12021 ___

[issue12021] mmap.read requires an argument

2011-06-05 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: 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 I'm not sure about the original reason, but I find None as the default omitted value

[issue12021] mmap.read requires an argument

2011-06-05 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Antoine Pitrou wrote: I'm not sure about the original reason, but I find None as the default omitted value prettier than -1 myself, so I think it's a good thing :) Yeah, and it's also good for consistency with other file-like objects. Can I

[issue12021] mmap.read requires an argument

2011-05-31 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org 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? -- ___ Python tracker rep...@bugs.python.org

[issue12021] mmap.read requires an argument

2011-05-31 Thread Charles-François Natali
Charles-François Natali neolo...@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.

[issue12021] mmap.read requires an argument

2011-05-30 Thread Charles-François Natali
Charles-François Natali neolo...@free.fr added the comment: The patch looks good to me. In your test, you don't explicitely close the mmap object: it's not a problem with CPython since it will get unmmapped, and the file descriptor - if it's a file-backed mapping - will get closed, as soon as

[issue12021] mmap.read requires an argument

2011-05-30 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Thanks for the comments. I attached a new patch that uses self.addCleanup(m.close), and also adds a versionchanged directive to the docs. -- Added file: http://bugs.python.org/file22199/mmap_read_all_3.patch

[issue12021] mmap.read requires an argument

2011-05-27 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Added a patch. It was only a matter of making the size parameter optional. -- keywords: +patch nosy: +petri.lehtinen Added file: http://bugs.python.org/file22142/mmap_read_all.patch ___ Python tracker

[issue12021] mmap.read requires an argument

2011-05-27 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Updated the patch to also update the documentation of mmap.read(). -- Added file: http://bugs.python.org/file22143/mmap_read_all_2.patch ___ Python tracker rep...@bugs.python.org

[issue12021] mmap.read requires an argument

2011-05-07 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12021 ___ ___ Python-bugs-list mailing

[issue12021] mmap.read requires an argument

2011-05-06 Thread K Richard Pixley
New submission from K Richard Pixley r...@noir.com: mmap.read requires a argument. Since most file-like objects do not, this breaks the file-like object illusion. mmap.read argument should be optional, presumably defaulting to the entire mmap'd area. -- messages: 135362 nosy:

[issue12021] mmap.read requires an argument

2011-05-06 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Sounds like a reasonable request, although I don't think it's a bug fix in itself (there are probably other places where mmap breaks the file-like expectation). -- nosy: +pitrou stage: - needs patch type: behavior - feature request

[issue12021] mmap.read requires an argument

2011-05-06 Thread Nadeem Vawda
Changes by Nadeem Vawda nadeem.va...@gmail.com: -- nosy: +nadeem.vawda ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12021 ___ ___