Fix JSON wrong encoding tests on big endian platforms#1781
Merged
lovelydinosaur merged 1 commit intoencode:masterfrom Aug 5, 2021
Merged
Fix JSON wrong encoding tests on big endian platforms#1781lovelydinosaur merged 1 commit intoencode:masterfrom
lovelydinosaur merged 1 commit intoencode:masterfrom
Conversation
Fix test_json_without_specified_encoding_*_error tests on big endian platforms. The tests wrongly assume that data encoded as "utf-32-be" can not be decoded as "utf-32". This is true on little endian platforms but on big endian platforms "utf-32" is equivalent to "utf-32-be". To avoid the problem, explicitly decode as "utf-32-le", as this should trigger the expected exception independently of platform's endianness.
Contributor
Author
|
I'm sorry for not raising a discussion but for such trivial changes, even if you told me it's all wrong I've spent less time doing it wrong then I'd going through all the formalities. |
Contributor
|
Sure thing... Looking at the codebase I can see that this just makes more sense now, so I'm good with it. (Eg. does it actually fail on a particular platform you were working on, and what was it?) |
Contributor
Author
|
One of our ppc64 testers hit the test failure. |
Contributor
Author
|
(with the Gentoo package) |
|
For reference, this was bug 802195 in Gentoo. We have a bunch of big (and little) endian platforms we test popular packages on. |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix test_json_without_specified_encoding_*_error tests on big endian
platforms. The tests wrongly assume that data encoded as "utf-32-be"
can not be decoded as "utf-32". This is true on little endian platforms
but on big endian platforms "utf-32" is equivalent to "utf-32-be".
To avoid the problem, explicitly decode as "utf-32-le", as this should
trigger the expected exception independently of platform's endianness.