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
Surrogates fix fails tests with PyPy on Windows #552
Comments
Hmm, interesting. And it's not just the |
This smells like a bug in PyPy. I have verified that The fix is likely the same as for that broken |
I have a working implementation with |
I believe that abandoning |
PyPy's Windows unicode handling transpired to be significantly different enough that a PyPy+Windows specific test failure slipped in (ultrajson#552).
This feature needs fixing. See ultrajson#552.
Well, PyPy has a Maybe we can add a clever check somewhere to ensure that the types match during compilation. Something like this, functionally (as this doesn't actually work, I think): #if sizeof(Py_UCS4) != sizeof(uint32_t)
#error "Py_UCS4 does not match uint32_t
#endif |
This feature needs fixing. See ultrajson#552.
What? Why? [splutter splutter splutter] Yeah, that check would be useful. It don't think the test failures would be that self explainatory if |
So I haven't done assertions at compile-time before. The clean way to do that is typedef char assert_py_ucs4_is_jsuint32[1 - 2*!!(sizeof(Py_UCS4) == sizeof(JSUINT32))]; Slightly cursed, but hey, at least it works. :-) |
That's so ugly that it's comical. We've got to have it! (Honestly, I don't even want to know how that works.) |
This feature needs fixing. See ultrajson#552.
The funny thing is that it's actually one of the cleaner ways to do this. I suppose There's an older, uglier version: #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) The actual error is the exact same reasoning, and the Aanyway, enough about this. I'll prepare a PR. Edit: Actually had the logic messed up there; a true comparison is equal to 1, a false one 0. The condition is what must be true for compilation to fail in this ... thing. A single exclamation mark should invert the meaning. |
This fixes character handling on platforms with 16-bit wchar_t (notably, Windows), which was broken (in different ways) on both CPython and PyPy. Fixes ultrajson#552
This fixes character handling on platforms with 16-bit wchar_t (notably, Windows), which was broken (in different ways) on both CPython and PyPy. Fixes ultrajson#552
This fixes character handling on platforms with 16-bit wchar_t (notably, Windows), which was broken (in different ways) on both CPython and PyPy. Fixes ultrajson#552
What did you do?
Built wheels on CI using https://github.com/ultrajson/ultrajson/blob/main/.github/workflows/deploy.yml.
What did you expect to happen?
All wheels built.
What actually happened?
Failed to build PyPy wheels on Windows due to
test_decode_surrogate_characters
failures:Before PR #550 was merged, wheels were successfully built.
What versions are you using?
main
after Fix handling of surrogates on decoding #550 merged.PR #547 is partly to blame for removing PyPy + Windows from the CI.
Temporarily enabling a full Python x OS matrix, all pass before #550:
https://github.com/hugovk/ultrajson/actions/runs/2511636309
After the merge, all pass except
pypy-3.7
andpypy3.8
onwindows-latest
:https://github.com/hugovk/ultrajson/actions/runs/2511595253
The text was updated successfully, but these errors were encountered: