FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-33767: Fix improper use of SystemError by mmap.mmap objects by ZackerySpytz · Pull Request #7381 · python/cpython · GitHub

Repository navigation

bpo-33767: Fix improper use of SystemError by mmap.mmap objects - #7381

Merged
serhiy-storchaka merged 3 commits into
python:masterfrom
ZackerySpytz:mmap_systemerror
Jun 5, 2018
Merged

serhiy-storchaka merged 3 commits into
python:masterfrom
ZackerySpytz:mmap_systemerror

Conversation

ZackerySpytz commented Jun 4, 2018 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

An alternative would be to remove mmap_concat() and mmap_repeat() to rely on the default TypeError.

https://bugs.python.org/issue33767

Comment thread Lib/test/test_mmap.py Outdated
self.assertRaises(ValueError, m.write, b'abc')

def test_concat_repeat_exception(self):
# A SystemError was raised on two unsupported sequence operations.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Just a nitpick, but I think we can drop this comment. If future readers want to know more about the test, they will find it via git blame.

@@ -0,0 +1,2 @@
Fix improper use of :exc:`SystemError` by :class:`mmap.mmap` objects. Patch

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Could you also mention that the + and * operations will now raise TypeErrors?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I suggest to reword this entry something like: "Conatenating (``+``) and repeating (``*``) of :class:`mmap.mmap` objects now raises :exc:`TypeError` instead of :exc:`SystemError`."

serhiy-storchaka merged commit e9e3976 into python:master Jun 5, 2018

Copy link
Copy Markdown
Contributor

Thanks @ZackerySpytz for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.6, 3.7.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 5, 2018
…onGH-7381)

Raise TypeError instead of SystemError for unsupported operations.
(cherry picked from commit e9e3976)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>

Copy link
Copy Markdown

GH-7426 is a backport of this pull request to the 3.7 branch.

Copy link
Copy Markdown
Contributor

Sorry, @ZackerySpytz and @serhiy-storchaka, I could not cleanly backport this to 2.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker e9e397605789b2a67b67558fbbe756b7b88934f5 2.7

Copy link
Copy Markdown

GH-7427 is a backport of this pull request to the 3.6 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 5, 2018
…onGH-7381)

Raise TypeError instead of SystemError for unsupported operations.
(cherry picked from commit e9e3976)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
miss-islington added a commit that referenced this pull request Jun 5, 2018
)

Raise TypeError instead of SystemError for unsupported operations.
(cherry picked from commit e9e3976)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this pull request Jun 5, 2018
…pythonGH-7381)

Raise TypeError instead of SystemError for unsupported operations..
(cherry picked from commit e9e3976)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>

Copy link
Copy Markdown

GH-7432 is a backport of this pull request to the 2.7 branch.

miss-islington added a commit that referenced this pull request Jun 5, 2018
)

Raise TypeError instead of SystemError for unsupported operations.
(cherry picked from commit e9e3976)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Jun 5, 2018
…GH-7381) (GH-7432)

Raise TypeError instead of SystemError for unsupported operations.
(cherry picked from commit e9e3976)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
ZackerySpytz deleted the mmap_systemerror branch June 11, 2018 06:13
serhiy-storchaka removed their assignment Oct 30, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL