]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-133982: Run unclosed file test on all io implementations (gh-134165) (gh...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 21 May 2025 15:28:29 +0000 (17:28 +0200)
committerGitHub <noreply@github.com>
Wed, 21 May 2025 15:28:29 +0000 (17:28 +0200)
commite1e8533a5d2ded9ba14e6129abf0fad8305def75
tree18b4f76718a9d0fd5f32a07b6149071b3e588a37
parent046125e5b6a0e9bfa260c9e2c20f4d84fb832fbb
[3.13] gh-133982: Run unclosed file test on all io implementations (gh-134165) (gh-134434)

Update `test_io` `_check_warn_on_dealloc` to use `self.` to dispatch to
different I/O implementations.

Update the `_pyio` implementation to match expected behavior, using the
same `_dealloc_warn` design as the C implementation uses to report the
topmost `__del__` object.

The FileIO one now matches all the others, so can use IOBase. There was
a missing check on closing (self._fd must be valid), add that check
(cherry picked from commit 5b0e82752120a5dc66ce6ee778751d71ba2c33b2)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Lib/_pyio.py
Lib/test/test_io.py
Misc/NEWS.d/next/Library/2025-05-17-20-23-57.gh-issue-133982.smS7au.rst [new file with mode: 0644]