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

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

index 58896b0e7967f815de969e82144ce272c5f45f4a..774192e812fc22f5e6cf9a999f23751a52e01210 100644 (file)
@@ -141,6 +141,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 f036a60ce08a661dda0f1c5e523f319166ceb23b..55861f942891dac1819ed1fc2ef0c57c2f1df6c9 100644 (file)
@@ -23,6 +23,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 9f18a610936b8704780ba962265d7321d7a6b55c..6e7bc535f60d4335a1400c2cbeb99afd336ca646 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 and setting/getting locales under Turkish