GeezerVison is showing github.com — gh-149879: Fix test_strptime on Cygwin by vstinner · Pull Request #150438 · python/cpython
Conversation
vstinner
commented
May 26, 2026
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Skip my_MM and or_IN locales on multiple tests, since the tests fail on Cygwin.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Skip my_MM and or_IN locales on multiple tests, since the tests fail
on Cygwin.
|
Cygwin uses the newlib C library. Multiple test_strptime tests with my_MM and or_IN locales.
Details
======================================================================
ERROR: test_date_locale (test.test_strptime.StrptimeTests.test_date_locale) (locale='my_MM')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/vstinner/cpython/Lib/test/support/__init__.py", line 1156, in wrapper
func(self, *args, **kwargs)
~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/test/test_strptime.py", line 555, in test_date_locale
self.roundtrip('%x', slice(0, 3), time.localtime(now))
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/test/test_strptime.py", line 304, in roundtrip
strp_output = _strptime._strptime_time(strf_output, fmt)
File "/home/vstinner/cpython/Lib/_strptime.py", line 812, in _strptime_time
tt = _strptime(data_string, format)[0]
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/_strptime.py", line 574, in _strptime
raise ValueError("time data %r does not match format %r" %
(data_string, format))
ValueError: time data '20၂၆ မေ ၂၆ အင်္ဂါ' does not match format '%x'
======================================================================
ERROR: test_date_locale (test.test_strptime.StrptimeTests.test_date_locale) (locale='or_IN')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/vstinner/cpython/Lib/test/support/__init__.py", line 1156, in wrapper
func(self, *args, **kwargs)
~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/test/test_strptime.py", line 555, in test_date_locale
self.roundtrip('%x', slice(0, 3), time.localtime(now))
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/test/test_strptime.py", line 304, in roundtrip
strp_output = _strptime._strptime_time(strf_output, fmt)
File "/home/vstinner/cpython/Lib/_strptime.py", line 812, in _strptime_time
tt = _strptime(data_string, format)[0]
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/_strptime.py", line 574, in _strptime
raise ValueError("time data %r does not match format %r" %
(data_string, format))
ValueError: time data '୨୬-୫-୨୬' does not match format '%x'
======================================================================
ERROR: test_date_locale2 (test.test_strptime.StrptimeTests.test_date_locale2) (locale='my_MM')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/vstinner/cpython/Lib/test/support/__init__.py", line 1156, in wrapper
func(self, *args, **kwargs)
~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/test/test_strptime.py", line 575, in test_date_locale2
self.roundtrip('%x', slice(0, 3), (1900, 1, 1, 0, 0, 0, 0, 1, 0))
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/test/test_strptime.py", line 304, in roundtrip
strp_output = _strptime._strptime_time(strf_output, fmt)
File "/home/vstinner/cpython/Lib/_strptime.py", line 812, in _strptime_time
tt = _strptime(data_string, format)[0]
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/_strptime.py", line 574, in _strptime
raise ValueError("time data %r does not match format %r" %
(data_string, format))
ValueError: time data '19၀၀ ဇန် ၀၀၀၁ တနင်္လာ' does not match format '%x'
======================================================================
ERROR: test_date_time_locale (test.test_strptime.StrptimeTests.test_date_time_locale) (locale='my_MM')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/vstinner/cpython/Lib/test/support/__init__.py", line 1156, in wrapper
func(self, *args, **kwargs)
~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/test/test_strptime.py", line 517, in test_date_time_locale
self.roundtrip('%c', slice(0, 6), time.localtime(now))
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/test/test_strptime.py", line 304, in roundtrip
strp_output = _strptime._strptime_time(strf_output, fmt)
File "/home/vstinner/cpython/Lib/_strptime.py", line 812, in _strptime_time
tt = _strptime(data_string, format)[0]
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/_strptime.py", line 574, in _strptime
raise ValueError("time data %r does not match format %r" %
(data_string, format))
ValueError: time data '20၂၆ မေ ၂၆ အင်္ဂါ ၀၁:၄၈:၀၁ နံနက်' does not match format '%c'
======================================================================
ERROR: test_date_time_locale (test.test_strptime.StrptimeTests.test_date_time_locale) (locale='or_IN')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/vstinner/cpython/Lib/test/support/__init__.py", line 1156, in wrapper
func(self, *args, **kwargs)
~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/test/test_strptime.py", line 517, in test_date_time_locale
self.roundtrip('%c', slice(0, 6), time.localtime(now))
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/test/test_strptime.py", line 304, in roundtrip
strp_output = _strptime._strptime_time(strf_output, fmt)
File "/home/vstinner/cpython/Lib/_strptime.py", line 812, in _strptime_time
tt = _strptime(data_string, format)[0]
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/_strptime.py", line 574, in _strptime
raise ValueError("time data %r does not match format %r" %
(data_string, format))
ValueError: time data '୨୬ ମେ ୨୬ ୧:୪୮:୧ AM' does not match format '%c'
======================================================================
ERROR: test_date_time_locale2 (test.test_strptime.StrptimeTests.test_date_time_locale2) (locale='my_MM')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/vstinner/cpython/Lib/test/support/__init__.py", line 1156, in wrapper
func(self, *args, **kwargs)
~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/test/test_strptime.py", line 544, in test_date_time_locale2
self.roundtrip('%c', slice(0, 6), (1900, 1, 1, 0, 0, 0, 0, 1, 0))
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/test/test_strptime.py", line 304, in roundtrip
strp_output = _strptime._strptime_time(strf_output, fmt)
File "/home/vstinner/cpython/Lib/_strptime.py", line 812, in _strptime_time
tt = _strptime(data_string, format)[0]
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/_strptime.py", line 574, in _strptime
raise ValueError("time data %r does not match format %r" %
(data_string, format))
ValueError: time data '19၀၀ ဇန် ၀၀၀၁ တနင်္လာ ၁၂:၀၀:၀၀ နံနက်' does not match format '%c'
======================================================================
ERROR: test_time_locale (test.test_strptime.StrptimeTests.test_time_locale) (locale='or_IN')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/vstinner/cpython/Lib/test/support/__init__.py", line 1156, in wrapper
func(self, *args, **kwargs)
~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/test/test_strptime.py", line 600, in test_time_locale
self.roundtrip('%X', pos, time.localtime(now))
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/test/test_strptime.py", line 304, in roundtrip
strp_output = _strptime._strptime_time(strf_output, fmt)
File "/home/vstinner/cpython/Lib/_strptime.py", line 812, in _strptime_time
tt = _strptime(data_string, format)[0]
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/home/vstinner/cpython/Lib/_strptime.py", line 574, in _strptime
raise ValueError("time data %r does not match format %r" %
(data_string, format))
ValueError: time data '୧:୪୮:୧ AM' does not match format '%X'
----------------------------------------------------------------------
Ran 60 tests in 1.686s
FAILED (errors=7, skipped=19)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
"Tests / Sanitizers / UBSan" failed, but the failure is unrelated to this change.
0:03:01 load avg: 8.06 mem: 128.1 MiB [ 69/503/1] test.test_multiprocessing_fork.test_processes failed (1 error) (43.9 sec) -- running (1): test.test_multiprocessing_forkserver.test_manager (30.9 sec)
Warning -- Dangling processes: {<Process name='Process-152' pid=22369 parent=20628 started daemon>}
Warning -- Dangling processes: {<Process name='Process-152' pid=22369 parent=20628 started daemon>}
test test.test_multiprocessing_fork.test_processes failed -- Traceback (most recent call last):
File "/home/runner/work/cpython/cpython/Lib/contextlib.py", line 116, in inner
return func(*args, **kwds)
File "/home/runner/work/cpython/cpython/Lib/test/_test_multiprocessing.py", line 649, in test_interrupt
exitcode = self._kill_process(multiprocessing.Process.interrupt)
File "/home/runner/work/cpython/cpython/Lib/contextlib.py", line 116, in inner
return func(*args, **kwds)
File "/home/runner/work/cpython/cpython/Lib/test/_test_multiprocessing.py", line 630, in _kill_process
self.assertEqual(join(), None)
~~~~^^
File "/home/runner/work/cpython/cpython/Lib/test/_test_multiprocessing.py", line 303, in __call__
return self.func(*args, **kwds)
~~~~~~~~~^^^^^^^^^^^^^^^
File "/home/runner/work/cpython/cpython/Lib/multiprocessing/process.py", line 156, in join
res = self._popen.wait(timeout)
File "/home/runner/work/cpython/cpython/Lib/multiprocessing/popen_fork.py", line 44, in wait
return self.poll(os.WNOHANG if timeout == 0.0 else 0)
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/cpython/cpython/Lib/multiprocessing/popen_fork.py", line 28, in poll
pid, sts = os.waitpid(self.pid, flag)
~~~~~~~~~~^^^^^^^^^^^^^^^^
File "/home/runner/work/cpython/cpython/Lib/test/_test_multiprocessing.py", line 626, in handler
raise RuntimeError('join took too long: %s' % p)
RuntimeError: join took too long: <Process name='Process-152' pid=22369 parent=20628 started daemon>
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Oh, I would have liked a solution that covers some more platforms, since I know Solaris has similar issues with its system libraries.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The skip_cygwin_locale() function can be renamed to skip_broken_locale() and adapted to skip other locales on other platforms.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
pganssle
Awaiting requested review from pganssle
pganssle is a code owner
StanFromIreland
Awaiting requested review from StanFromIreland
StanFromIreland is a code owner
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|