Skip to content

test_strptime fails on musl libc hosts #146315

@awilfox

Description

@awilfox

Bug report

Bug description:

This is basically the exact same bug as #139624, except it's on Linux/musl instead of AIX.

0:01:59 load avg: 17.13 [2/4/2] test_strptime failed (9 failures)
Re-running test_strptime in verbose mode (matching: test_date_locale2, test_date_locale2, test_date_locale2, test_date_locale2, test_date_locale2, test_date_locale2, test_date_locale2, test_date_locale2, test_date_locale2)
test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) ... 
  test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='en_US') ... FAIL
  test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='fr_FR') ... FAIL
  test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='de_DE') ... FAIL
  test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='ja_JP') ... FAIL
  test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='eu_ES') ... FAIL
  test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='ar_AE') ... FAIL
  test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='my_MM') ... FAIL
  test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='shn_MM') ... FAIL
  test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='lzh_TW') ... FAIL

======================================================================
FAIL: test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='en_US')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/support/__init__.py", line 1046, in wrapper
    func(self, *args, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/test_strptime.py", line 572, in test_date_locale2
    self.roundtrip('%x', slice(0, 3), (1900, 1, 1, 0, 0, 0, 0, 1, 0))
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/test_strptime.py", line 309, in roundtrip
    self.assertEqual(strp_output[position], time_tuple[position],
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    "testing of %r format failed; %r -> %r != %r" %
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     (fmt, strf_output, strp_output[position],
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      time_tuple[position]))
                      ^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Tuples differ: (2000, 1, 1) != (1900, 1, 1)

First differing element 0:
2000
1900

- (2000, 1, 1)
?  ^^

+ (1900, 1, 1)
?  ^^
 : testing of '%x' format failed; '01/01/00' -> (2000, 1, 1) != (1900, 1, 1)

======================================================================
FAIL: test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='fr_FR')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/support/__init__.py", line 1046, in wrapper
    func(self, *args, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/test_strptime.py", line 572, in test_date_locale2
    self.roundtrip('%x', slice(0, 3), (1900, 1, 1, 0, 0, 0, 0, 1, 0))
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/test_strptime.py", line 309, in roundtrip
    self.assertEqual(strp_output[position], time_tuple[position],
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    "testing of %r format failed; %r -> %r != %r" %
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     (fmt, strf_output, strp_output[position],
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      time_tuple[position]))
                      ^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Tuples differ: (2000, 1, 1) != (1900, 1, 1)

First differing element 0:
2000
1900

- (2000, 1, 1)
?  ^^

+ (1900, 1, 1)
?  ^^
 : testing of '%x' format failed; '01/01/00' -> (2000, 1, 1) != (1900, 1, 1)

======================================================================
FAIL: test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='de_DE')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/support/__init__.py", line 1046, in wrapper
    func(self, *args, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/test_strptime.py", line 572, in test_date_locale2
    self.roundtrip('%x', slice(0, 3), (1900, 1, 1, 0, 0, 0, 0, 1, 0))
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/test_strptime.py", line 309, in roundtrip
    self.assertEqual(strp_output[position], time_tuple[position],
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    "testing of %r format failed; %r -> %r != %r" %
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     (fmt, strf_output, strp_output[position],
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      time_tuple[position]))
                      ^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Tuples differ: (2000, 1, 1) != (1900, 1, 1)

First differing element 0:
2000
1900

- (2000, 1, 1)
?  ^^

+ (1900, 1, 1)
?  ^^
 : testing of '%x' format failed; '01/01/00' -> (2000, 1, 1) != (1900, 1, 1)

======================================================================
FAIL: test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='ja_JP')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/support/__init__.py", line 1046, in wrapper
    func(self, *args, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/test_strptime.py", line 572, in test_date_locale2
    self.roundtrip('%x', slice(0, 3), (1900, 1, 1, 0, 0, 0, 0, 1, 0))
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/test_strptime.py", line 309, in roundtrip
    self.assertEqual(strp_output[position], time_tuple[position],
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    "testing of %r format failed; %r -> %r != %r" %
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     (fmt, strf_output, strp_output[position],
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      time_tuple[position]))
                      ^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Tuples differ: (2000, 1, 1) != (1900, 1, 1)

First differing element 0:
2000
1900

- (2000, 1, 1)
?  ^^

+ (1900, 1, 1)
?  ^^
 : testing of '%x' format failed; '01/01/00' -> (2000, 1, 1) != (1900, 1, 1)

======================================================================
FAIL: test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='eu_ES')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/support/__init__.py", line 1046, in wrapper
    func(self, *args, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/test_strptime.py", line 572, in test_date_locale2
    self.roundtrip('%x', slice(0, 3), (1900, 1, 1, 0, 0, 0, 0, 1, 0))
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/test_strptime.py", line 309, in roundtrip
    self.assertEqual(strp_output[position], time_tuple[position],
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    "testing of %r format failed; %r -> %r != %r" %
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     (fmt, strf_output, strp_output[position],
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      time_tuple[position]))
                      ^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Tuples differ: (2000, 1, 1) != (1900, 1, 1)

First differing element 0:
2000
1900

- (2000, 1, 1)
?  ^^

+ (1900, 1, 1)
?  ^^
 : testing of '%x' format failed; '01/01/00' -> (2000, 1, 1) != (1900, 1, 1)

======================================================================
FAIL: test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='ar_AE')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/support/__init__.py", line 1046, in wrapper
    func(self, *args, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/test_strptime.py", line 572, in test_date_locale2
    self.roundtrip('%x', slice(0, 3), (1900, 1, 1, 0, 0, 0, 0, 1, 0))
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/test_strptime.py", line 309, in roundtrip
    self.assertEqual(strp_output[position], time_tuple[position],
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    "testing of %r format failed; %r -> %r != %r" %
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     (fmt, strf_output, strp_output[position],
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      time_tuple[position]))
                      ^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Tuples differ: (2000, 1, 1) != (1900, 1, 1)

First differing element 0:
2000
1900

- (2000, 1, 1)
?  ^^

+ (1900, 1, 1)
?  ^^
 : testing of '%x' format failed; '01/01/00' -> (2000, 1, 1) != (1900, 1, 1)

======================================================================
FAIL: test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='my_MM')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/support/__init__.py", line 1046, in wrapper
    func(self, *args, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/test_strptime.py", line 572, in test_date_locale2
    self.roundtrip('%x', slice(0, 3), (1900, 1, 1, 0, 0, 0, 0, 1, 0))
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/test_strptime.py", line 309, in roundtrip
    self.assertEqual(strp_output[position], time_tuple[position],
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    "testing of %r format failed; %r -> %r != %r" %
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     (fmt, strf_output, strp_output[position],
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      time_tuple[position]))
                      ^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Tuples differ: (2000, 1, 1) != (1900, 1, 1)

First differing element 0:
2000
1900

- (2000, 1, 1)
?  ^^

+ (1900, 1, 1)
?  ^^
 : testing of '%x' format failed; '01/01/00' -> (2000, 1, 1) != (1900, 1, 1)

======================================================================
FAIL: test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='shn_MM')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/support/__init__.py", line 1046, in wrapper
    func(self, *args, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/test_strptime.py", line 572, in test_date_locale2
    self.roundtrip('%x', slice(0, 3), (1900, 1, 1, 0, 0, 0, 0, 1, 0))
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/test_strptime.py", line 309, in roundtrip
    self.assertEqual(strp_output[position], time_tuple[position],
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    "testing of %r format failed; %r -> %r != %r" %
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     (fmt, strf_output, strp_output[position],
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      time_tuple[position]))
                      ^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Tuples differ: (2000, 1, 1) != (1900, 1, 1)

First differing element 0:
2000
1900

- (2000, 1, 1)
?  ^^

+ (1900, 1, 1)
?  ^^
 : testing of '%x' format failed; '01/01/00' -> (2000, 1, 1) != (1900, 1, 1)

======================================================================
FAIL: test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='lzh_TW')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/support/__init__.py", line 1046, in wrapper
    func(self, *args, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/test_strptime.py", line 572, in test_date_locale2
    self.roundtrip('%x', slice(0, 3), (1900, 1, 1, 0, 0, 0, 0, 1, 0))
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.13.11/work/Python-3.13.11/Lib/test/test_strptime.py", line 309, in roundtrip
    self.assertEqual(strp_output[position], time_tuple[position],
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    "testing of %r format failed; %r -> %r != %r" %
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     (fmt, strf_output, strp_output[position],
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      time_tuple[position]))
                      ^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Tuples differ: (2000, 1, 1) != (1900, 1, 1)

First differing element 0:
2000
1900

- (2000, 1, 1)
?  ^^

+ (1900, 1, 1)
?  ^^
 : testing of '%x' format failed; '01/01/00' -> (2000, 1, 1) != (1900, 1, 1)

----------------------------------------------------------------------
Ran 1 test in 0.048s

FAILED (failures=9)
test test_strptime failed

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-unsupportedpendingThe issue will be closed if no feedback is providedtestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    No status

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions