Fix error with surrogate characters in strftime#1
Closed
pganssle wants to merge 9 commits intoizbyshev:bpo-34482from
Closed
Fix error with surrogate characters in strftime#1pganssle wants to merge 9 commits intoizbyshev:bpo-34482from
pganssle wants to merge 9 commits intoizbyshev:bpo-34482from
Conversation
Now that the bug is fixed, the try/catch can be removed.
Author
|
I'm not a core dev so I can't push directly to your branch. |
Owner
|
@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? |
Author
|
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. |
Owner
|
@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.
izbyshev
pushed a commit
that referenced
this pull request
Dec 9, 2020
* 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 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.
This fixes the bug and updates the tests.