Closed dataflake closed 2 years ago
I have updated the CI configuration here so it tests for Windows as well: https://github.com/zopefoundation/DateTime/actions/runs/3020975789
Jens Vagelpohl wrote at 2022-9-9 01:15 -0700:
In the process of updating the DateTime version pin for Zope and running the CI tests I discovered that a recent change is incompatible with Windows. The tests fail with this traceback:
Error in test test_format (DateTime.tests.test_datetime.DateTimeTests) Traceback (most recent call last): File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\unittest\case.py", line 59, in testPartExecutor yield File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\unittest\case.py", line 605, in run testMethod() File "d:\a\zope\zope\.tox\py36\eggs\datetime-4.5-py3.6.egg\DateTime\tests\test_datetime.py", line 690, in test_format result = dt.strftime(fmt) File "d:\a\zope\zope\.tox\py36\eggs\datetime-4.5-py3.6.egg\DateTime\DateTime.py", line 1566, in strftime microseconds).strftime(format) ValueError: Invalid format string
Almost surely, the test is to blame.
The test uses the format %-d.%-m.%Y %H:%M
.
The -
prefixes for the format codes d
and m
look suspicious --
potentially, they are not supported by all C runtimes (specifically
the Windows C library).
Dieter Maurer wrote at 2022-9-9 11:12 +0200:
Jens Vagelpohl wrote at 2022-9-9 01:15 -0700:
In the process of updating the DateTime version pin for Zope and running the CI tests I discovered that a recent change is incompatible with Windows. The tests fail with this traceback:
Error in test test_format (DateTime.tests.test_datetime.DateTimeTests) Traceback (most recent call last): File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\unittest\case.py", line 59, in testPartExecutor yield File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\unittest\case.py", line 605, in run testMethod() File "d:\a\zope\zope\.tox\py36\eggs\datetime-4.5-py3.6.egg\DateTime\tests\test_datetime.py", line 690, in test_format result = dt.strftime(fmt) File "d:\a\zope\zope\.tox\py36\eggs\datetime-4.5-py3.6.egg\DateTime\DateTime.py", line 1566, in strftime microseconds).strftime(format) ValueError: Invalid format string
Almost surely, the test is to blame. The test uses the format
%-d.%-m.%Y %H:%M
. The-
prefixes for the format codesd
andm
look suspicious -- potentially, they are not supported by all C runtimes (specifically the Windows C library).
According to the Linux man page (for strftime
),
the -
prefix belongs to a glibc
extension
The test should not use it.
In the process of updating the DateTime version pin for Zope and running the CI tests I discovered that a recent change is incompatible with Windows. The tests fail with this traceback:
The corresponding code is part of #37.