gh-53203: Fix strptime() for %c, %x and %X formats on many locales (GH-125406)

Fixed most locales that use non-ASCII digits, like Persian, Burmese,
Odia and Shan.
This commit is contained in:
Serhiy Storchaka 2024-10-14 16:29:20 +03:00 committed by GitHub
parent 06ca33020e
commit 5f4e5b598c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 66 additions and 40 deletions

View file

@ -298,7 +298,7 @@ class TimeTestCase(unittest.TestCase):
# additional check for IndexError branch (issue #19545)
with self.assertRaises(ValueError) as e:
time.strptime('19', '%Y %')
self.assertIs(e.exception.__suppress_context__, True)
self.assertIsNone(e.exception.__context__)
def test_strptime_leap_year(self):
# GH-70647: warns if parsing a format with a day and no year.