summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2018-08-22 18:21:05 (GMT)
committerGitHub <noreply@github.com>2018-08-22 18:21:05 (GMT)
commite7d4b2f205c711d056bea73a0093e2e2b200544b (patch)
tree3a442a760dd83416b2141757f4bf546b623b6f36 /Doc
parent28853a249b1d0c890b7e9ca345290bb8c1756446 (diff)
downloadcpython-e7d4b2f205c711d056bea73a0093e2e2b200544b.zip
cpython-e7d4b2f205c711d056bea73a0093e2e2b200544b.tar.gz
cpython-e7d4b2f205c711d056bea73a0093e2e2b200544b.tar.bz2
bpo-2122: Make mmap.flush() behave same on all platforms (GH-8692)
Previously, its behavior was platform-dependent and there was no error checking under Windows.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/mmap.rst10
-rw-r--r--Doc/whatsnew/3.8.rst7
2 files changed, 13 insertions, 4 deletions
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst
index ca09a6a..c8ae7a6 100644
--- a/Doc/library/mmap.rst
+++ b/Doc/library/mmap.rst
@@ -191,11 +191,13 @@ To map anonymous memory, -1 should be passed as the fileno along with the length
changes to the given range of bytes will be flushed to disk; otherwise, the
whole extent of the mapping is flushed.
- **(Windows version)** A nonzero value returned indicates success; zero
- indicates failure.
+ ``None`` is returned to indicate success. An exception is raised when the
+ call failed.
- **(Unix version)** A zero value is returned to indicate success. An
- exception is raised when the call failed.
+ .. versionchanged:: 3.8
+ Previously, a nonzero value was returned on success; zero was returned
+ on error under Windows. A zero value was returned on success; an
+ exception was raised on error under Unix.
.. method:: move(dest, src, count)
diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst
index 1f816a1..d07896b 100644
--- a/Doc/whatsnew/3.8.rst
+++ b/Doc/whatsnew/3.8.rst
@@ -265,6 +265,13 @@ Changes in the Python API
task name is visible in the ``repr()`` output of :class:`asyncio.Task` and
can also be retrieved using the :meth:`~asyncio.Task.get_name` method.
+* The :meth:`mmap.flush() <mmap.mmap.flush>` method now returns ``None`` on
+ success and raises an exception on error under all platforms. Previously,
+ its behavior was platform-depended: a nonzero value was returned on success;
+ zero was returned on error under Windows. A zero value was returned on
+ success; an exception was raised on error under Unix.
+ (Contributed by Berker Peksag in :issue:`2122`.)
+
CPython bytecode changes
------------------------