[issue42853] `OverflowError: signed integer is greater than maximum` in ssl.py for files larger than 2GB

Christian Heimes report at bugs.python.org
Wed Jul 28 18:34:25 EDT 2021


Christian Heimes <lists at cheimes.de> added the comment:

A patch would not land in Python 3.9 since this would be a new feature and out-of-scope for a released version.

Do you really want to store gigabytes of downloads in RAM instead of doing chunked reads and store them on disk? If you cannot or don't want to write to disk, then there are easier and better ways to deal with large buffers. You could either mmap() or you could use a memoryview of a bytearray buffer:

   buf = bytearray(4 * 1024**3)
   view = memoryview(buf)
   pos = 0
   while True:
       read = conn.recv_into(view[pos:pos+1048576])
       if not read:
           break
       pos += read

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42853>
_______________________________________


More information about the Python-bugs-list mailing list