Skip to content

✅ test(strict-soft): check a closed descriptor by errno - #875

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
KennyMcSimpson:fix/locale-independent-descriptor-check
Oct 28, 2026
Merged

gaborbernat merged 1 commit into
tox-dev:mainfrom
KennyMcSimpson:fix/locale-independent-descriptor-check

Conversation

@KennyMcSimpson

@KennyMcSimpson KennyMcSimpson commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

On a Chinese-language Windows, test_strict_soft_sentinel_inspection_failure_closes_descriptor failed because it matched the English text of the closed-descriptor error, and Windows reports that text in the system language ([WinError 6] 句柄无效。). The lock had closed the descriptor as intended; only the assertion depended on the locale. Contributors on a non-English Windows can now run the suite without a spurious failure.

The test now checks errno == EBADF through the check= predicate of pytest.raises, the same shape the suite already uses for the symlink refusal errnos. The errno is the same on every platform, while the message is not. The remaining message matches in the suite target Python-generated or C-runtime text, which stays English regardless of the system language.

@gaborbernat gaborbernat added the skip news Internal change; exempt from the news fragment check label Oct 28, 2026
@gaborbernat gaborbernat changed the title test: avoid localized messages in closed-descriptor checks ✅ test(strict-soft): check a closed descriptor by errno Oct 28, 2026
@gaborbernat gaborbernat reopened this Oct 28, 2026
@gaborbernat gaborbernat reopened this Oct 28, 2026
@gaborbernat
gaborbernat merged commit 363c626 into tox-dev:main Oct 28, 2026
72 of 100 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news Internal change; exempt from the news fragment check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants