Skip to content

[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

[3.13] gh-150484: Fix mock_open __exit__ with contextlib.ExitStack (GH-151829)#151861
serhiy-storchaka merged 1 commit into
python:3.13from
miss-islington:backport-85fa295-3.13

Conversation

@miss-islington

@miss-islington miss-islington commented Jun 21, 2026

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 serhiy-storchaka merged commit bae0ba9 into python:3.13 Jun 21, 2026
42 checks passed
@miss-islington miss-islington deleted the backport-85fa295-3.13 branch June 21, 2026 17:02
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