[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light
/ cpython Public
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-2122: Make mmap.flush() behave same on all platforms #8692

Merged
merged 7 commits into from Aug 22, 2018

Conversation

Copy link
Member

berkerpeksag commented Aug 6, 2018

Copy link
Member

serhiy-storchaka commented Aug 15, 2018

Is it possible to test a failed mmap.flush()?

Since this is a behavior breaking change, please add a note in What's New (section "Changes in the Python API").

Copy link
Member Author

berkerpeksag commented Aug 21, 2018

Is it possible to test a failed mmap.flush()?

It's possible to get EINVAL under Unix, but I don't know about Windows. I've just pushed a test and let's see what happens.

Since this is a behavior breaking change, please add a note in What's New (section "Changes in the Python API").

Done.

Copy link
Member Author

berkerpeksag commented Aug 21, 2018

Since we already do range checking in mmap_flush_method(), I don't think it's easy to trigger an error under Windows.

@@ -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,
Copy link
Member

serhiy-storchaka Aug 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to accent the main reason of this change. "Previously, the behavior was platform-depended: on success, a nonzero value was returned under Windows and a zero value was returned under Unix, on error, zero was returned under Windows and an exception was raised under Unix." Maybe native speakers can suggest better wording. In any case this PR LGTM.

Copy link
Member Author

berkerpeksag Aug 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I just tweaked it a bit.

berkerpeksag merged commit e7d4b2f into python:master Aug 22, 2018
7 of 9 checks passed
berkerpeksag deleted the 2122-mmap-flush branch Aug 22, 2018
yahya-abou-imran pushed a commit to yahya-abou-imran/cpython that referenced this pull request Nov 2, 2018
Previously, its behavior was platform-dependent and there was no error checking
under Windows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants