summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorRoss Lagerwall <rosslagerwall@gmail.com>2011-07-25 05:12:43 (GMT)
committerRoss Lagerwall <rosslagerwall@gmail.com>2011-07-25 05:12:43 (GMT)
commit59c01edcaa4a973e159d2ed3a5084936d3fffa18 (patch)
treed4ea70ea2ad7cdfea73ce8ae9942c6a92b3980dd /Doc/library
parent749400a94d78bb714a8964c21f8979ab6b070708 (diff)
downloadcpython-59c01edcaa4a973e159d2ed3a5084936d3fffa18.zip
cpython-59c01edcaa4a973e159d2ed3a5084936d3fffa18.tar.gz
cpython-59c01edcaa4a973e159d2ed3a5084936d3fffa18.tar.bz2
Issue #12102: Document that buffered files must be flushed before being used
with mmap. Patch by Steffen Daode Nurpmeso.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/mmap.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst
index 7a901c9..6a74a14 100644
--- a/Doc/library/mmap.rst
+++ b/Doc/library/mmap.rst
@@ -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`