Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 59c01ed

Browse files
committed
Issue #12102: Document that buffered files must be flushed before being used
with mmap. Patch by Steffen Daode Nurpmeso.
1 parent 749400a commit 59c01ed

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

Doc/ACKS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ [email protected]), and we'll be glad to correct the problem.
144144
* Sjoerd Mullender
145145
* Dale Nagata
146146
* Michal Nowikowski
147+
* Steffen Daode Nurpmeso
147148
* Ng Pheng Siong
148149
* Koray Oner
149150
* Tomas Oppelstrup

Doc/library/mmap.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ file object, use its :meth:`fileno` method to obtain the correct value for the
2121
:func:`os.open` function, which returns a file descriptor directly (the file
2222
still needs to be closed when done).
2323

24+
.. note::
25+
If you want to create a memory-mapping for a writable, buffered file, you
26+
should :func:`~io.IOBase.flush` the file first. This is necessary to ensure
27+
that local modifications to the buffers are actually available to the
28+
mapping.
29+
2430
For both the Unix and Windows versions of the constructor, *access* may be
2531
specified as an optional keyword parameter. *access* accepts one of three
2632
values: :const:`ACCESS_READ`, :const:`ACCESS_WRITE`, or :const:`ACCESS_COPY`

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ Core and Builtins
3737
Library
3838
-------
3939

40+
- Issue #12102: Document that buffered files must be flushed before being used
41+
with mmap. Patch by Steffen Daode Nurpmeso.
42+
4043
- Issue #12560: Build libpython.so on OpenBSD. Patch by Stefan Sperling.
4144

4245
- Issue #1813: Fix codec lookup under Turkish locales.

0 commit comments

Comments
 (0)