Skip to content

tests: use errno.EBADF instead of hardcoded number in _close_file()#148345

Merged
gpshead merged 1 commit intopython:mainfrom
artemyarulin:patch-1
Apr 12, 2026
Merged

tests: use errno.EBADF instead of hardcoded number in _close_file()#148345
gpshead merged 1 commit intopython:mainfrom
artemyarulin:patch-1

Conversation

@artemyarulin
Copy link
Copy Markdown
Contributor

Replace the hardcoded 9 check in Lib/test/test_interpreters/utils.py with errno.EBADF.

Using errno.EBADF makes the helper portable across platforms with different errno numbering while preserving the intended behavior.

Didn't create an issue for that as I think it could count as trivial

…ose_file()

Replace the hardcoded `9` check in `Lib/test/test_interpreters/utils.py` with `errno.EBADF`.

Using `errno.EBADF` makes the helper portable across platforms with different errno numbering while preserving the intended behavior.
@python-cla-bot
Copy link
Copy Markdown

python-cla-bot bot commented Apr 10, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 10, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@artemyarulin artemyarulin changed the title test_interpreters: use errno.EBADF instead of hardcoded number in _close_file() trivial: use errno.EBADF instead of hardcoded number in _close_file() Apr 11, 2026
@picnixz picnixz changed the title trivial: use errno.EBADF instead of hardcoded number in _close_file() tests: use errno.EBADF instead of hardcoded number in _close_file() Apr 11, 2026
@picnixz picnixz added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes skip issue skip news labels Apr 11, 2026
@gpshead gpshead merged commit cef334f into python:main Apr 12, 2026
62 checks passed
@miss-islington-app
Copy link
Copy Markdown

Thanks @artemyarulin for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 12, 2026
…ythonGH-148345)

test_interpreters: use errno.EBADF instead of hardcoded number in _close_file()

Replace the hardcoded `9` check in `Lib/test/test_interpreters/utils.py` with `errno.EBADF`.

Using `errno.EBADF` makes the helper portable across platforms with different errno numbering while preserving the intended behavior.
(cherry picked from commit cef334fd4c4c24a542ce81ad940b1426b5a7cdbd)

Co-authored-by: Artem Yarulin <artem.yarulin@kapteko.com>
@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 12, 2026

GH-148410 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Apr 12, 2026
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 12, 2026
…ythonGH-148345)

test_interpreters: use errno.EBADF instead of hardcoded number in _close_file()

Replace the hardcoded `9` check in `Lib/test/test_interpreters/utils.py` with `errno.EBADF`.

Using `errno.EBADF` makes the helper portable across platforms with different errno numbering while preserving the intended behavior.
(cherry picked from commit cef334fd4c4c24a542ce81ad940b1426b5a7cdbd)

Co-authored-by: Artem Yarulin <artem.yarulin@kapteko.com>
@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 12, 2026

GH-148411 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants