[issue31651] io.FileIO cannot write more than 2GB (-4096) bytes??? must be documented (if not fixed)

Serhiy Storchaka report at bugs.python.org
Sun Oct 1 04:30:32 EDT 2017


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

> On Linux, write() (and similar system calls) will transfer at most 0x7ffff000 (2,147,479,552) bytes, returning the number of bytes 
> actually transferred.  (This is true on both 32-bit and 64-bit 
> systems.)

This is platform-depending limitation. It can be be changed in future. In addition, there are other causes of writing not all data (see `man 2 write`).

> Also, it might be nice to add a note on top, that this module is for 'low level' IO interface, and that it is recommended to use regular file type for typical file operations (not io.FileIO) to avoid necessity of dealing limitations such as the one mentioned.

This is not true for the module overall. And this is already documented for io.RawIOBase:

"""
Raw binary I/O typically provides low-level access to an underlying OS device or API, and does not try to encapsulate it in high-level primitives (this is left to Buffered I/O and Text I/O, described later in this page).
"""

----------
nosy: +serhiy.storchaka

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


More information about the Python-bugs-list mailing list