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

[3.13] gh-150484: Fix mock_open __exit__ with contextlib.ExitStack (GH-151829) by miss-islington · Pull Request #151861 · python/cpython · GitHub

Repository navigation

[3.13] gh-150484: Fix mock_open __exit__ with contextlib.ExitStack (GH-151829) - #151861

Merged
serhiy-storchaka merged 1 commit into
python:3.13from
miss-islington:backport-85fa295-3.13
Jun 21, 2026
Merged

serhiy-storchaka merged 1 commit into
python:3.13from
miss-islington:backport-85fa295-3.13

Conversation

miss-islington commented Jun 21, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

mock_open's _exit_side_effect had a fixed 3-arg signature, but
contextlib.ExitStack calls exit with 4 args (self + 3 exc info).
Use *args to accept any number of arguments.
(cherry picked from commit 85fa295)

Co-authored-by: Zang Peiyu 166481866+factnn@users.noreply.github.com

…ack (pythonGH-151829)

  mock_open's _exit_side_effect had a fixed 3-arg signature, but
  contextlib.ExitStack calls __exit__ with 4 args (self + 3 exc info).
  Use *args to accept any number of arguments.
(cherry picked from commit 85fa295)

Co-authored-by: Zang Peiyu <166481866+factnn@users.noreply.github.com>
serhiy-storchaka merged commit bae0ba9 into python:3.13 Jun 21, 2026
42 checks passed
miss-islington deleted the backport-85fa295-3.13 branch June 21, 2026 17:02
factnn added a commit to factnn/cpython that referenced this pull request Oct 21, 2026
…Stack

mock_open().__exit__ only misbehaves on 3.13 and 3.14, where it was
fixed directly by pythonGH-151829 and backported as pythonGH-151861. Only the
regression test belongs on main.
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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL