-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-33767: Fix improper use of SystemError by mmap.mmap objects #7381
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
Conversation
Lib/test/test_mmap.py
Outdated
@@ -734,6 +734,14 @@ def test_resize_past_pos(self): | |||
self.assertRaises(ValueError, m.write_byte, 42) | |||
self.assertRaises(ValueError, m.write, b'abc') | |||
|
|||
def test_concat_repeat_exception(self): | |||
# A SystemError was raised on two unsupported sequence operations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also mention that the + and * operations will now raise TypeError
s?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to reword this entry something like: "Conatenating (``+``) and repeating (``*``) of :class:`mmap.mmap` objects now raises :exc:`TypeError` instead of :exc:`SystemError`.
"
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. |
…onGH-7381) Raise TypeError instead of SystemError for unsupported operations. (cherry picked from commit e9e3976) Co-authored-by: Zackery Spytz <[email protected]>
GH-7426 is a backport of this pull request to the 3.7 branch. |
Sorry, @ZackerySpytz and @serhiy-storchaka, I could not cleanly backport this to |
GH-7427 is a backport of this pull request to the 3.6 branch. |
…onGH-7381) Raise TypeError instead of SystemError for unsupported operations. (cherry picked from commit e9e3976) Co-authored-by: Zackery Spytz <[email protected]>
) Raise TypeError instead of SystemError for unsupported operations. (cherry picked from commit e9e3976) Co-authored-by: Zackery Spytz <[email protected]>
…pythonGH-7381) Raise TypeError instead of SystemError for unsupported operations.. (cherry picked from commit e9e3976) Co-authored-by: Zackery Spytz <[email protected]>
GH-7432 is a backport of this pull request to the 2.7 branch. |
) Raise TypeError instead of SystemError for unsupported operations. (cherry picked from commit e9e3976) Co-authored-by: Zackery Spytz <[email protected]>
…GH-7381) (GH-7432) Raise TypeError instead of SystemError for unsupported operations. (cherry picked from commit e9e3976) Co-authored-by: Zackery Spytz <[email protected]>
An alternative would be to remove
mmap_concat()
andmmap_repeat()
to rely on the default TypeError.https://bugs.python.org/issue33767