Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-95027: Ensure test runner uses utf-8:surrogateescape for communicating with subprocesses #96669

Closed
wants to merge 1 commit into from

Conversation

zooba
Copy link
Member

@zooba zooba commented Sep 7, 2022

@terryjreedy
Copy link
Member

terryjreedy commented Sep 8, 2022

I tried to hand-apply this patch to installed 3.11.0rc1, but Lib/test/libregrtest/runtest_mp.py has changed too much. I tried copying the patched 3.12 libregrtest into 3.11, but that did not work either. I then ran the test with -j0 in updated main and got the same error as on the issue. Finally, I created a branch from this pr and ran the tests in paralled again and they ran to completion. So this patch appears to fix the issue I reported. (There were other problems -- see issue.) So from my viewpoint, it looks good.

env = dict(os.environ)
env['PYTHONIOENCODING'] = 'utf-8:surrogateescape'
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer to test the Python "default" encoding, and so fix code which decodes test stdout instead.

Copy link
Member

Choose a reason for hiding this comment

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

Python test suite worked well with any encoding for years without having to force an encoding, it was broken recently to support WASM.

Copy link
Member Author

Choose a reason for hiding this comment

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

Then remove the encoding='utf-8' from the code that reads from the file.

But since this isn't testing, and is just IPC between test runners, I'd prefer to keep full fidelity in the data.

@vstinner
Copy link
Member

I wrote my PR #98492 Is this change still relevant?

@zooba zooba closed this Oct 24, 2022
@zooba zooba deleted the gh-95027 branch October 24, 2022 15:59
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.

4 participants