bpo-34481: Fix surrogate-handling in strftime#8983
bpo-34481: Fix surrogate-handling in strftime#8983pganssle wants to merge 10 commits intopython:masterfrom
Conversation
…gs in datetime classes A follow-up of bpo-34454.
Now that the bug is fixed, the try/catch can be removed.
This is now also a more complete fix for bpo-6697.
This will cut down on some of the per-environment variability of this function.
This reverts commit 3973be1.
This passes a backslash-escaped unicode string to strftime in the event that locale encoding fails. To ensure that the relevant string is round-trippable, all backslashes in the original string are double-escaped, and then unescaped when the result is decoded.
This reverts commit c1381d5.
|
I have no idea how to reproduce this failure. It works fine on my home computer (Arch Linux), on a debian VPS and a debian WSL. All are succeeding. I think that this will start succeeding on Linux as well if I re-enable |
|
I'm able to reproduce this issue only on Ubuntu 14. For some reason with #include <stdlib.h>
#include <stdio.h>
int main() {
const wchar_t str[] = L"\xd800";
char buffer[32];
int rv = wcstombs(NULL, str, 0);
printf("%d\n", rv);
}Works fine on both Ubuntu 14 and other Linux (returns |
|
This is too annoying for me to continue working on it. Anyone else is free to pick up where I left off. |
This is intended to be re-based against #8878 - that PR adds tests, this one adds the fix.
I am making this PR before that one is merged mainly because this is some crazy platform-specific behavior, and I want to test it on the full cross-platform test suite.
https://bugs.python.org/issue34481
https://bugs.python.org/issue34481