-
Notifications
You must be signed in to change notification settings - Fork 0
Fix error with surrogate characters in strftime #1
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
Conversation
Now that the bug is fixed, the try/catch can be removed.
|
I'm not a core dev so I can't push directly to your branch. |
|
@pganssle Thank you for actually fixing the problem! Would you prefer to add tests and merge it separately as the PR for bpo-34481 or combine our PRs and fix both issues at the same time? |
|
Doesn't really matter to me, but thinking about it more, we should probably do it as two separate PRs (I'll wait for yours to get merged), so that I can easily update it in response to review comments. |
|
@pganssle You also need to handle |
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.
* bpo-40791: Make compare_digest more constant-time. The existing volatile `left`/`right` pointers guarantee that the reads will all occur, but does not guarantee that they will be _used_. So a compiler can still short-circuit the loop, saving e.g. the overhead of doing the xors and especially the overhead of the data dependency between `result` and the reads. That would change performance depending on where the first unequal byte occurs. This change removes that optimization. (This is change #1 from https://bugs.python.org/issue40791 .)
This fixes the bug and updates the tests.