[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

Martin v. Löwis report at bugs.python.org
Sun Apr 13 17:53:49 CEST 2014


Martin v. Löwis added the comment:

Josh: it's not as simple as just changing the type code and variable type. Systems used to require all kinds of types in the length parameter of read(2) and fread(3), including int, long, and size_t. If it was int, passing size_t would lead to silent truncation. So at a minimum, a careful review of the further processing, and a test case is necessary.

I'm personally not interested in Python 2.7 anymore, so I certainly won't work on this.

As for why this isn't reported frequently, I guess a number of causes:
a) people don't use Python on Windows that much to process large files
b) when they do and run into this problem, they feel guilty for actually asking for a such large chunk, which could well exhaust the memory of the system.
c) there is a straight-forward work-around
d) people that do read large files typically either read them at once, or in much smaller chunks

So it may well be that this remains the only report of this for the rest of Python 2.7's life.

----------

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


More information about the Python-bugs-list mailing list