Skip to content

Handle filesystem surrogate characters in test node ID hashes - #751

Open
xiehuanyi wants to merge 1 commit into
pytest-dev:mainfrom
xiehuanyi:fix-surrogate-node-ids
Open

xiehuanyi wants to merge 1 commit into
pytest-dev:mainfrom
xiehuanyi:fix-surrogate-node-ids

Conversation

@xiehuanyi

Copy link
Copy Markdown

A Linux test filename containing an undecodable filesystem byte produces a surrogate-containing node ID. With pytest's cache provider disabled, ordinary pytest runs it successfully, but pytest-randomly aborts collection while hashing the node ID with strict UTF-8 encoding.

Use UTF-8 surrogatepass for the hash input, preserving the encoding and order for existing ordinary Unicode IDs. Add an end-to-end filename regression and a changelog entry.

Validation: the new regression fails before and passes afterward. All 40 tests pass, including with the warning-as-error settings from tox. All applicable repository-pinned pre-commit checks pass.

Scope: pytest's separate cache serialization limitation still requires -p no:cacheprovider for such filenames. The filesystem regression runs on Linux.

Prepared and verified with Codex (GPT-6.1-sol) assistance.

Copilot AI balanced review requested due to automatic review settings October 11, 2026 18:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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.

2 participants