◐ Shell
clean mode source ↗

gh-116608: Ignore UTF-16 BOM in importlib.resources._functional tests by encukou · Pull Request #117569 · python/cpython

… tests

To test the `errors` argument, we read a UTF-16 file as UTF-8
with "backslashreplace" error handling. However, the utf-16
codec adds an endian-specific byte-order mark, so on big-endian
machines the expectation doesn't match the test file (which was
saved on a little-endian machine).

Use endswith to ignore the BOM.

@encukou encukou changed the title gh-116609: Ignore UTF-16 BOM in importlib.resources._functional tests gh-116608: Ignore UTF-16 BOM in importlib.resources._functional tests

Apr 5, 2024

@encukou encukou deleted the importlib-tests-be branch

April 5, 2024 15:00

diegorusso pushed a commit to diegorusso/cpython that referenced this pull request

Apr 17, 2024
… tests (pythonGH-117569)

pythongh-116609: Ignore UTF-16 BOM in importlib.resources._functional tests

To test the `errors` argument, we read a UTF-16 file as UTF-8
with "backslashreplace" error handling. However, the utf-16
codec adds an endian-specific byte-order mark, so on big-endian
machines the expectation doesn't match the test file (which was
saved on a little-endian machine).

Use endswith to ignore the BOM.

jaraco added a commit to python/importlib_resources that referenced this pull request

Aug 14, 2024