bpo-33767: Fix improper use of SystemError by mmap.mmap objects#7381
Conversation
| 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.
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.
Could you also mention that the + and * operations will now raise TypeErrors?
There was a problem hiding this comment.
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 <zspytz@gmail.com>
|
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 <zspytz@gmail.com>
) Raise TypeError instead of SystemError for unsupported operations. (cherry picked from commit e9e3976) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
…pythonGH-7381) Raise TypeError instead of SystemError for unsupported operations.. (cherry picked from commit e9e3976) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
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 <zspytz@gmail.com>
An alternative would be to remove
mmap_concat()andmmap_repeat()to rely on the default TypeError.https://bugs.python.org/issue33767