gh-66571: Expand matches for %Z in strptime #93486
Open
+42
−12
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.
I had sent a message a while back to the datetime-sig mailing list in regard to this issue and got some more direction from there. That also prompted a brief discussion with @pganssle on the original ticket.
In particular, @pganssle had suggested simply expanding the range of inputs that %Z will accept. Paul had mentioned any 3-4 characters, but I had noticed there was some timezone abbreviations with 2 characters (such as CT) and some with as many as 5 (such as CHADT) so I made that the max here.
The PR tries to take a more conservative approach by simply adding on the 2-5 character match if the machine's locale and UTC/GMT check first fail.
(?P<Z>[a-z]{2,5})
.Closes #66571