Skip to content

test_date_locale2 fails on AIX#139624

@furkanonder

Description

@furkanonder

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-mtesttest_strptime-mtest_date_locale2-v==CPython3.15.0a0 (main, Oct52025, 21:17:47) [GCC8.3.0] ==AIX-2-00FA9D314C00-powerpc-32bitbig-endian==Pythonbuild: debug==cwd:/python/pdev/cpython-main/build/test_python_worker_5309142æ==CPUcount: 16==encodings: locale=ISO8859-1FS=utf-8==resources: alltestresourcesaredisabled, use-uoptiontounskiptestsUsingrandomseed: 27607677200:00:00Run1testsequentiallyinasingleprocess0:00:00 [1/1] test_strptimetest_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) ... test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='en_US') ... FAILtest_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 (mostrecentcalllast): File"/python/pdev/cpython-main/Lib/test/support/__init__.py", line1045, inwrapperfunc(self, *args, **kwargs) ~~~~^^^^^^^^^^^^^^^^^^^^^^^File"/python/pdev/cpython-main/Lib/test/test_strptime.py", line576, intest_date_locale2self.roundtrip('%x', slice(0, 3), (1900, 1, 1, 0, 0, 0, 0, 1, 0)) ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/python/pdev/cpython-main/Lib/test/test_strptime.py", line306, inroundtripself.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: Tuplesdiffer: (2000, 1, 1) != (1900, 1, 1) Firstdifferingelement0: 20001900- (2000, 1, 1) ? ^^+ (1900, 1, 1) ? ^^ : testingof'%x'formatfailed; '01/01/00'-> (2000, 1, 1) != (1900, 1, 1) ----------------------------------------------------------------------Ran1testin0.022sFAILED (failures=1, skipped=8) testtest_strptimefailed0:00:00 [1/1/1] test_strptimefailed (1failure) ==Testsresult: FAILURE==1testfailed: test_strptimeTotalduration: 561msTotaltests: run=1 (filtered) failures=1skipped=8Totaltestfiles: run=1/1 (filtered) failed=1Result: FAILURE

Environment

  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixes3.15new features, bugs and security fixesOS-unsupportedextension-modulesC modules in the Modules dirtestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions