8000 gh-53203: Fix strptime() for %c, %x and %X formats on some locales by serhiy-storchaka · Pull Request #135971 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-53203: Fix strptime() for %c, %x and %X formats on some locales #135971

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

Merged

Conversation

serhiy-storchaka
Copy link
Member
@serhiy-storchaka serhiy-storchaka commented Jun 26, 2025
  • Add detection of decimal non-ASCII alt digits.
  • Add support of non-decimal alt digits on locale lzh_TW.
  • Accept only numbers in correct range if alt digits are known.
  • Fix bug in detecting the position of the week day name on locales byn_ER and wal_ET.
  • Fix support of single-digit hour on locales ar_SA and bg_BG.
  • Add support for %T, %R, %r, %C, %OC.
  • Prepare code to use nl_langinfo().

* %c and %x formats on locales byn_ER, wal_ET and lzh_TW
* %X format on locales ar_SA, bg_BG and lzh_TW

Prepare code to use nl_langinfo().
@serhiy-storchaka
Copy link
Member Author

@kulikjak, could you please test this PR on Solaris?

@kulikjak
Copy link
Contributor

Sure, I tested the change and the test passes. We do not have those three letter locales, but both 'ar_SA' and 'bg_BG' are green.

Thanks for the ping!

@serhiy-storchaka serhiy-storchaka merged commit 07183eb into python:main Jun 27, 2025
46 checks passed
@miss-islington-app
Copy link

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@serhiy-storchaka serhiy-storchaka deleted the strptime-calc-alt-digits branch June 27, 2025 07:51
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 27, 2025
…les (pythonGH-135971)

* Add detection of decimal non-ASCII alt digits.
* Add support of non-decimal alt digits on locale lzh_TW.
* Accept only numbers in correct range if alt digits are known.
* Fix bug in detecting the position of the week day name on locales byn_ER and wal_ET.
* Fix support of single-digit hour on locales ar_SA and bg_BG.
* Add support for %T, %R, %r, %C, %OC.
* Prepare code to use nl_langinfo().
(cherry picked from commit 07183eb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 27, 2025
…les (pythonGH-135971)

* Add detection of decimal non-ASCII alt digits.
* Add support of non-decimal alt digits on locale lzh_TW.
* Accept only numbers in correct range if alt digits are known.
* Fix bug in detecting the position of the week day name on locales byn_ER and wal_ET.
* Fix support of single-digit hour on locales ar_SA and bg_BG.
* Add support for %T, %R, %r, %C, %OC.
* Prepare code to use nl_langinfo().
(cherry picked from commit 07183eb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link
bedevere-app bot commented Jun 27, 2025

GH-136019 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Jun 27, 2025
@bedevere-app
Copy link
bedevere-app bot commented Jun 27, 2025

GH-136020 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jun 27, 2025
@serhiy-storchaka
Copy link
Member Author

Thank you for testing.

serhiy-storchaka added a commit that referenced this pull request Jun 27, 2025
…ales (GH-135971) (GH-136020)

* Add detection of decimal non-ASCII alt digits.
* Add support of non-decimal alt digits on locale lzh_TW.
* Accept only numbers in correct range if alt digits are known.
* Fix bug in detecting the position of the week day name on locales byn_ER and wal_ET.
* Fix support of single-digit hour on locales ar_SA and bg_BG.
* Add support for %T, %R, %r, %C, %OC.
* Prepare code to use nl_langinfo().

(cherry picked from commit 07183eb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Jun 27, 2025
…ales (GH-135971) (GH-136019)

* Add detection of decimal non-ASCII alt digits.
* Add support of non-decimal alt digits on locale lzh_TW.
* Accept only numbers in correct range if alt digits are known.
* Fix bug in detecting the position of the week day name on locales byn_ER and wal_ET.
* Fix support of single-digit hour on locales ar_SA and bg_BG.
* Add support for %T, %R, %r, %C, %OC.
* Prepare code to use nl_langinfo().

(cherry picked from commit 07183eb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0