FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix functional API tests to be endian-agnostic by mgorny · Pull Request #313 · python/importlib_resources · GitHub

Fix functional API tests to be endian-agnostic - #313

Closed
mgorny wants to merge 1 commit into
python:mainfrom
mgorny:utf16be
Closed

Fix functional API tests to be endian-agnostic#313
mgorny wants to merge 1 commit into
python:mainfrom
mgorny:utf16be

Conversation

mgorny commented Jul 10, 2024

Copy link
Copy Markdown

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 closed this in ca5f0e1 Aug 14, 2024

jaraco commented Aug 14, 2024

Copy link
Copy Markdown
Member

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

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL