GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-33767: Fix improper use of SystemError by mmap.mmap objects by ZackerySpytz · Pull Request #7381 · python/cpython

Conversation

@ZackerySpytz

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

Uh oh!

There was an error while loading. Please reload this page.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ZackerySpytz
bpo-33767: Fix improper use of SystemError by mmap.mmap objects
3edf7b2
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Jun 4, 2018
@bedevere-bot bedevere-bot added the awaiting review label Jun 4, 2018
@ZackerySpytz
Remove mmap_concat() and mmap_repeat()
61d090c
berkerpeksag
berkerpeksag reviewed Jun 4, 2018
View reviewed changes
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.

@berkerpeksag berkerpeksag Jun 4, 2018

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Misc/NEWS.d/next/Library/2018-06-03-22-41-59.bpo-33767.2e82g3.rst Outdated
@@ -0,0 +1,2 @@
Fix improper use of :exc:`SystemError` by :class:`mmap.mmap` objects. Patch

@berkerpeksag berkerpeksag Jun 4, 2018

Copy link
Copy Markdown
Member

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 TypeErrors?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@serhiy-storchaka serhiy-storchaka Jun 4, 2018

Copy link
Copy Markdown
Member

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`."

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

berkerpeksag reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@ZackerySpytz
Delete comment, reword news entry
e649f1c
serhiy-storchaka
serhiy-storchaka approved these changes Jun 5, 2018
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Jun 5, 2018
@serhiy-storchaka serhiy-storchaka added type-bug An unexpected behavior, bug, or error needs backport to 3.6 labels Jun 5, 2018
berkerpeksag
berkerpeksag approved these changes Jun 5, 2018
View reviewed changes
@serhiy-storchaka
serhiy-storchaka merged commit e9e3976 into python:master Jun 5, 2018
@miss-islington

miss-islington commented 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.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting merge label Jun 5, 2018
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 5, 2018
@ZackerySpytz @miss-islington
bpo-33767: Fix improper use of SystemError by mmap.mmap objects (pyth…
ca7bc83
…onGH-7381)

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

Co-authored-by: Zackery Spytz <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.7 label Jun 5, 2018
@bedevere-bot

bedevere-bot commented Jun 5, 2018

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington

miss-islington commented Jun 5, 2018

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington miss-islington assigned serhiy-storchaka Jun 5, 2018
@bedevere-bot

bedevere-bot commented Jun 5, 2018

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.6 label Jun 5, 2018
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 5, 2018
@ZackerySpytz @miss-islington
bpo-33767: Fix improper use of SystemError by mmap.mmap objects (pyth…
3b93f8e
…onGH-7381)

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

Co-authored-by: Zackery Spytz <[email protected]>
miss-islington added a commit that referenced this pull request Jun 5, 2018
@miss-islington @ZackerySpytz
bpo-33767: Fix improper use of SystemError by mmap.mmap objects (GH-7381
631fe1f
)

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

Co-authored-by: Zackery Spytz <[email protected]>
serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this pull request Jun 5, 2018
@ZackerySpytz @serhiy-storchaka
[2.7] bpo-33767: Fix improper use of SystemError by mmap.mmap objects (…
0c53c8f
…pythonGH-7381)

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

Co-authored-by: Zackery Spytz <[email protected]>
@bedevere-bot

bedevere-bot commented Jun 5, 2018

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 2.7 label Jun 5, 2018
miss-islington added a commit that referenced this pull request Jun 5, 2018
@miss-islington @ZackerySpytz
bpo-33767: Fix improper use of SystemError by mmap.mmap objects (GH-7381
ae55d29
)

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

Co-authored-by: Zackery Spytz <[email protected]>
serhiy-storchaka added a commit that referenced this pull request Jun 5, 2018
@serhiy-storchaka @ZackerySpytz
[2.7] bpo-33767: Fix improper use of SystemError by mmap.mmap objects (…
3014d6e
…GH-7381) (GH-7432)

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

Co-authored-by: Zackery Spytz <[email protected]>
@ZackerySpytz
ZackerySpytz deleted the mmap_systemerror branch June 11, 2018 06:13
@serhiy-storchaka serhiy-storchaka removed their assignment Oct 30, 2018
@serhiy-storchaka serhiy-storchaka mentioned this pull request Aug 28, 2025
mmap.resize() can raise SystemError #138205
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@berkerpeksag berkerpeksag berkerpeksag approved these changes
@serhiy-storchaka serhiy-storchaka serhiy-storchaka approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@ZackerySpytz @miss-islington @bedevere-bot @berkerpeksag @serhiy-storchaka @the-knights-who-say-ni
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.