[Python-Dev] [Python-checkins] cpython (2.7): Issue #10276: test_zlib checks that inputs of 2 GB are handled correctly by (original) (raw)

Nadeem Vawda nadeem.vawda at gmail.com
Thu May 5 11:43:19 CEST 2011


On Thu, May 5, 2011 at 11:33 AM, Victor Stinner <victor.stinner at haypocalc.com> wrote:

Le mercredi 04 mai 2011 à 15:40 -0700, Ethan Furman a écrit :

The comment says 'check that inputs of 2 GB are handled correctly' but the file created is 1 byte short of 2Gb.  Is the test wrong, or just wrongly commented?  Or am I not understanding? If you write a byte after 2 GB of zeros, the file size is 2 GB+the few bytes. This trick is to create quickly a large file: some OSes support sparse files, zeros are not written on disk. But on Mac OS X and Windows, you really write 2 GB+some bytes.

Ethan's point is that 0x7FFFFFFF is not 2GB - it is (2G-1) bytes. So the test and the preceding comment are inconsistent.



More information about the Python-Dev mailing list