]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #12102: Document that buffered files must be flushed before being used
authorRoss Lagerwall <rosslagerwall@gmail.com>
Mon, 25 Jul 2011 05:12:43 +0000 (07:12 +0200)
committerRoss Lagerwall <rosslagerwall@gmail.com>
Mon, 25 Jul 2011 05:12:43 +0000 (07:12 +0200)
with mmap. Patch by Steffen Daode Nurpmeso.

Doc/ACKS.txt
Doc/library/mmap.rst
Misc/NEWS

index 1ad18f15b3e6ed9ed934111881f5238741463457..c5282478c6ae4f13678b7770e55acce5db1d74dd 100644 (file)
@@ -144,6 +144,7 @@ docs@python.org), and we'll be glad to correct the problem.
    * Sjoerd Mullender
    * Dale Nagata
    * Michal Nowikowski
+   * Steffen Daode Nurpmeso
    * Ng Pheng Siong
    * Koray Oner
    * Tomas Oppelstrup
index 7a901c93f7e0f14b1c3d56fe3302fada5ca0cc3a..6a74a14351d9cf804cfa809991a319cff33f8af1 100644 (file)
@@ -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`
index 3fcdc9600c68182f4f81ce705dbf29d36bb3d795..662eedc8d8ae8d961c484f5e98daa52e90b09b67 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -37,6 +37,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #12102: Document that buffered files must be flushed before being used
+  with mmap. Patch by Steffen Daode Nurpmeso.
+
 - Issue #12560: Build libpython.so on OpenBSD. Patch by Stefan Sperling.
 
 - Issue #1813: Fix codec lookup under Turkish locales.