Repository navigation
test_date_locale2 fails on AIX #139624
Copy link
Copy link
Closed
Labels
3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixesOS-unsupportedextension-modulesC modules in the Modules dirC modules in the Modules dirtestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
AIX's strptime implementation exhibits different behavior for 2-digit year interpretation compared to other platforms. The expected behavior should interpret 2-digit years 00-68 as 2000-2068 and 69-99 as 1969-1999, but AIX appears to use different cutoff logic
-bash-4.2$ ./python -m test test_strptime -m test_date_locale2 -v
== CPython 3.15.0a0 (main, Oct 5 2025, 21:17:47) [GCC 8.3.0]
== AIX-2-00FA9D314C00-powerpc-32bit big-endian
== Python build: debug
== cwd: /python/pdev/cpython-main/build/test_python_worker_5309142æ
== CPU count: 16
== encodings: locale=ISO8859-1 FS=utf-8
== resources: all test resources are disabled, use -u option to unskip tests
Using random seed: 2760767720
0:00:00 Run 1 test sequentially in a single process
0:00:00 [1/1] test_strptime
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') ... skipped "no locale 'fr_FR'"
test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='de_DE') ... skipped "no locale 'de_DE'"
test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='ja_JP') ... skipped "no locale 'ja_JP'"
test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='eu_ES') ... skipped "no locale 'eu_ES'"
test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='ar_AE') ... skipped "no locale 'ar_AE'"
test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='my_MM') ... skipped "no locale 'my_MM'"
test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='shn_MM') ... skipped "no locale 'shn_MM'"
test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='lzh_TW') ... skipped "no locale 'lzh_TW'"
======================================================================
FAIL: test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='en_US')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/python/pdev/cpython-main/Lib/test/support/__init__.py", line 1045, in wrapper
func(self, *args, **kwargs)
~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "/python/pdev/cpython-main/Lib/test/test_strptime.py", line 576, in test_date_locale2
self.roundtrip('%x', slice(0, 3), (1900, 1, 1, 0, 0, 0, 0, 1, 0))
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/python/pdev/cpython-main/Lib/test/test_strptime.py", line 306, 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.022s
FAILED (failures=1, skipped=8)
test test_strptime failed
0:00:00 [1/1/1] test_strptime failed (1 failure)
== Tests result: FAILURE ==
1 test failed:
test_strptime
Total duration: 561 ms
Total tests: run=1 (filtered) failures=1 skipped=8
Total test files: run=1/1 (filtered) failed=1
Result: FAILUREEnvironment
- AIX Version: 7200-05-05-2245 (AIX 7.2 TL5 SP5)
I think updating the test suite to skip problematic locales on AIX for the %x format test, similar to the existing Solaris(#125785) workaround, would be a good choice.
CPython versions tested on:
CPython main branch, 3.15, 3.14, 3.13
Operating systems tested on:
Other
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixesOS-unsupportedextension-modulesC modules in the Modules dirC modules in the Modules dirtestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
- StatusShow more project fieldsDone
Activity
Merge branch 'main' into pythongh-139624
StanFromIreland commentedon Oct 5, 2025
It would be great to test this on the Buildbot, which is unfortunately currently failing at configure, did you use some patches to get it to build?
gh-139624: Skip problematic locales on AIX in test_date_locale2 (GH-1…
pythongh-139624: Skip problematic locales on AIX in test_date_locale2 (…
pythongh-139624: Skip problematic locales on AIX in test_date_locale2 (…
[3.13] gh-139624: Skip problematic locales on AIX in test_date_locale2 (
pythongh-139624: Skip problematic locales on AIX in test_date_locale2 (…
[3.14] gh-139624: Skip problematic locales on AIX in test_date_locale2 (