mirror of
https://github.com/python/cpython.git
synced 2025-10-27 16:57:08 +00:00
Issue #12102: Document that buffered files must be flushed before being used
with mmap. Patch by Steffen Daode Nurpmeso.
This commit is contained in:
parent
749400a94d
commit
59c01edcaa
3 changed files with 10 additions and 0 deletions
|
|
@ -21,6 +21,12 @@ file object, use its :meth:`fileno` method to obtain the correct value for the
|
|||
:func:`os.open` function, which returns a file descriptor directly (the file
|
||||
still needs to be closed when done).
|
||||
|
||||
.. note::
|
||||
If you want to create a memory-mapping for a writable, buffered file, you
|
||||
should :func:`~io.IOBase.flush` the file first. This is necessary to ensure
|
||||
that local modifications to the buffers are actually available to the
|
||||
mapping.
|
||||
|
||||
For both the Unix and Windows versions of the constructor, *access* may be
|
||||
specified as an optional keyword parameter. *access* accepts one of three
|
||||
values: :const:`ACCESS_READ`, :const:`ACCESS_WRITE`, or :const:`ACCESS_COPY`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue