8000 Fix functional API tests to be endian-agnostic by mgorny · Pull Request #313 · python/importlib_resources · GitHub
[go: up one dir, main page]

Skip to content

Fix functional API tests to be endian-agnostic #313

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

Closed
wants to merge 1 commit into from

Conversation

mgorny
Copy link
@mgorny mgorny commented Jul 10, 2024

Fix the "backslashreplace" tests for the functional API to be endian-agnostic. The tests used to rely on .encode("utf-16") producing the same data as found in the test file. However, on big endian platforms it would produce a big endian encoding, while the test file is little endian. To avoid the problem, explicitly specify utf-16-le encoding. Since this meant that the BOM is no longer produced, explicitly include it in input.

Fixes #312

Fix the "backslashreplace" tests for the functional API to be
endian-agnostic.  The tests used to rely on `.encode("utf-16")`
producing the same data as found in the test file.  However, on big
endian platforms it would produce a big endian encoding, while the test
file is little endian.  To avoid the problem, explicitly specify
`utf-16-le` encoding.  Since this meant that the BOM is no longer
produced, explicitly include it in input.

Fixes python#312
@jaraco jaraco closed this in ca5f0e1 Aug 14, 2024
@jaraco
Copy link
Member
jaraco commented Aug 14, 2024

Thanks for the contrib, and sorry I didn't see it sooner. This was superseded by 8c274e5.

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.

importlib_resources/tests/test_functional.py test failures on big endian architectures
2 participants
0