[issue3531] file read preallocs 'size' bytes which can cause memory problems

Antoine Pitrou report at bugs.python.org
Thu Sep 11 15:24:48 CEST 2008


Antoine Pitrou <pitrou at free.fr> added the comment:

> My code regularily calculates the sha1 sum of 10.000 files and because
> in another reuse of the code had to deal with files too big to fit in
> memory I set a limit of 256Mb.

Why don't you use a sensible buffer size, e.g. 1MB? Reading data in
256MB chunks sounds foolish in any case.

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


More information about the Python-bugs-list mailing list