gh-53203: Fix strptime() for %c and %x formats on many locales#124946
Merged
serhiy-storchaka merged 18 commits intopython:mainfrom Oct 12, 2024
Merged
gh-53203: Fix strptime() for %c and %x formats on many locales#124946serhiy-storchaka merged 18 commits intopython:mainfrom
serhiy-storchaka merged 18 commits intopython:mainfrom
Conversation
In some locales (for example French and Hebrew), the default month used in __calc_date_time has the same name in full and abbreviated form. So the code failed to correctly distinguish formats %b and %B. Co-authored-by: Eli Bendersky <eliben@gmail.com>
2c81238 to
1305285
Compare
zuo
reviewed
Oct 4, 2024
|
🤖 New build scheduled with the buildbot fleet by @serhiy-storchaka for commit ef8c18e 🤖 If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
Member
Author
|
!buildbot RHEL8 |
|
🤖 New build scheduled with the buildbot fleet by @serhiy-storchaka for commit fdfbef6 🤖 The command will test the builders whose names match following regular expression: The builders matched are:
|
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Oct 12, 2024
…ythonGH-124946) In some locales (like French or Hebrew) the full or abbreviated names of the default month and weekday used in __calc_date_time can be part of other name or constant part of the %c format. The month name can also match %m with constant suffix (like in Japanese). So the code failed to correctly distinguish formats %a, %A, %b, %B and %m. Cycle all month and all days of the week to find the variable part and distinguish %a from %A and %b from %B or %m. Fixed locales for the following languges: Arabic, Bislama, Breton, Bodo, Kashubian, Chuvash, Estonian, French, Irish, Ge'ez, Gurajati, Manx Gaelic, Hebrew, Hindi, Chhattisgarhi, Haitian Kreyol, Japanese, Kannada, Korean, Marathi, Malay, Norwegian, Nynorsk, Punjabi, Rajasthani, Tok Pisin, Yoruba, Yue Chinese, Yau/Nungon and Chinese. (cherry picked from commit c05f9dd) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Eli Bendersky <eliben@gmail.com>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Oct 12, 2024
…ythonGH-124946) In some locales (like French or Hebrew) the full or abbreviated names of the default month and weekday used in __calc_date_time can be part of other name or constant part of the %c format. The month name can also match %m with constant suffix (like in Japanese). So the code failed to correctly distinguish formats %a, %A, %b, %B and %m. Cycle all month and all days of the week to find the variable part and distinguish %a from %A and %b from %B or %m. Fixed locales for the following languges: Arabic, Bislama, Breton, Bodo, Kashubian, Chuvash, Estonian, French, Irish, Ge'ez, Gurajati, Manx Gaelic, Hebrew, Hindi, Chhattisgarhi, Haitian Kreyol, Japanese, Kannada, Korean, Marathi, Malay, Norwegian, Nynorsk, Punjabi, Rajasthani, Tok Pisin, Yoruba, Yue Chinese, Yau/Nungon and Chinese. (cherry picked from commit c05f9dd) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Eli Bendersky <eliben@gmail.com>
|
GH-125369 is a backport of this pull request to the 3.13 branch. |
|
GH-125370 is a backport of this pull request to the 3.12 branch. |
serhiy-storchaka
added a commit
that referenced
this pull request
Oct 12, 2024
…GH-124946) (GH-125370) In some locales (like French or Hebrew) the full or abbreviated names of the default month and weekday used in __calc_date_time can be part of other name or constant part of the %c format. The month name can also match %m with constant suffix (like in Japanese). So the code failed to correctly distinguish formats %a, %A, %b, %B and %m. Cycle all month and all days of the week to find the variable part and distinguish %a from %A and %b from %B or %m. Fixed locales for the following languges: Arabic, Bislama, Breton, Bodo, Kashubian, Chuvash, Estonian, French, Irish, Ge'ez, Gurajati, Manx Gaelic, Hebrew, Hindi, Chhattisgarhi, Haitian Kreyol, Japanese, Kannada, Korean, Marathi, Malay, Norwegian, Nynorsk, Punjabi, Rajasthani, Tok Pisin, Yoruba, Yue Chinese, Yau/Nungon and Chinese. (cherry picked from commit c05f9dd) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Eli Bendersky <eliben@gmail.com>
serhiy-storchaka
added a commit
that referenced
this pull request
Oct 12, 2024
…GH-124946) (GH-125369) In some locales (like French or Hebrew) the full or abbreviated names of the default month and weekday used in __calc_date_time can be part of other name or constant part of the %c format. The month name can also match %m with constant suffix (like in Japanese). So the code failed to correctly distinguish formats %a, %A, %b, %B and %m. Cycle all month and all days of the week to find the variable part and distinguish %a from %A and %b from %B or %m. Fixed locales for the following languges: Arabic, Bislama, Breton, Bodo, Kashubian, Chuvash, Estonian, French, Irish, Ge'ez, Gurajati, Manx Gaelic, Hebrew, Hindi, Chhattisgarhi, Haitian Kreyol, Japanese, Kannada, Korean, Marathi, Malay, Norwegian, Nynorsk, Punjabi, Rajasthani, Tok Pisin, Yoruba, Yue Chinese, Yau/Nungon and Chinese. (cherry picked from commit c05f9dd) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Eli Bendersky <eliben@gmail.com>
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.
Fixed locales:
Arabic, Bislama, Breton, Bodo, Kashubian, Chuvash, Estonian, French, Irish,
Ge'ez, Gurajati, Manx Gaelic, Hebrew, Hindi, Chhattisgarhi, Haitian Kreyol,
Japanese, Kannada, Korean, Marathi, Malay, Norwegian, Nynorsk, Punjabi,
Rajasthani, Tok Pisin, Yoruba, Yue Chinese, Yau/Nungon and Chinese.
In some locales, the default month used in __calc_date_time has the same name in full and abbreviated form. In others it conflicts with the day of the week name or other parts of the representation. So the code failed to correctly distinguish formats %b and %B.