Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.13.1 test_datetime failures #129483

Open
karel1980 opened this issue Jan 30, 2025 · 2 comments
Open

Python 3.13.1 test_datetime failures #129483

karel1980 opened this issue Jan 30, 2025 · 2 comments
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@karel1980
Copy link

karel1980 commented Jan 30, 2025

Bug report

Bug description:

Hi. I'm trying to build from source on a raspberry pi, on a fresh and fully updated debian bookworm install.

test_datetime was failing so I tried to get more information using make test TESTOPTS="-v test_datetime" as suggested by the readme, but that just runs all tests again without additional output for test_datetime (see terminal output pastedbelow.

I hope that's enough information. I'll try to look a bit further, this is just where I got the feeling it might not be 100% my own fault anymore ;)

karel@homeassistant:~/Python-3.13.0 $ lsb_release  -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 12 (bookworm)
Release:	12
Codename:	bookworm
karel@homeassistant:~/Python-3.13.0 $ uname -a
Linux homeassistant 6.6.51+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.51-1+rpt3 (2024-10-08) aarch64 GNU/Linux

Test output

karel@homeassistant:~/Python-3.13.1 $ make test TESTOPTS="-v test_datetime"
Running code to generate profile data (this can take a while):
# First, we need to create a clean build with profile generation
# enabled.
make profile-gen-stamp
make[1]: Entering directory '/home/karel/Python-3.13.1'
make[1]: 'profile-gen-stamp' is up to date.
make[1]: Leaving directory '/home/karel/Python-3.13.1'
# Next, run the profile task to generate the profile information.
./python -m test --pgo --timeout=
Using random seed: 1333715147
0:00:00 load avg: 0.33 Run 44 tests sequentially in a single process
0:00:00 load avg: 0.33 [ 1/44] test_array
0:00:02 load avg: 0.38 [ 2/44] test_base64
0:00:02 load avg: 0.38 [ 3/44] test_binascii
0:00:02 load avg: 0.38 [ 4/44] test_binop
0:00:02 load avg: 0.38 [ 5/44] test_bisect
0:00:03 load avg: 0.38 [ 6/44] test_bytes
0:00:08 load avg: 0.43 [ 7/44] test_bz2
0:00:09 load avg: 0.43 [ 8/44] test_cmath
0:00:10 load avg: 0.43 [ 9/44] test_codecs
0:00:11 load avg: 0.48 [10/44] test_collections
0:00:13 load avg: 0.48 [11/44] test_complex
0:00:14 load avg: 0.48 [12/44] test_dataclasses
0:00:15 load avg: 0.48 [13/44] test_datetime
test test_datetime failed
0:00:20 load avg: 0.52 [14/44] test_decimal -- test_datetime failed (4 failures)
0:00:26 load avg: 0.67 [15/44] test_difflib
0:00:27 load avg: 0.67 [16/44] test_embed
0:00:38 load avg: 0.72 [17/44] test_float
0:00:38 load avg: 0.72 [18/44] test_fstring
0:00:42 load avg: 0.74 [19/44] test_functools
0:00:43 load avg: 0.74 [20/44] test_generators
0:00:43 load avg: 0.74 [21/44] test_hashlib
0:00:44 load avg: 0.74 [22/44] test_heapq
0:00:45 load avg: 0.74 [23/44] test_int
0:00:46 load avg: 0.76 [24/44] test_itertools
0:00:53 load avg: 0.78 [25/44] test_json
... rest omitted...

CPython versions tested on:

3.13

Operating systems tested on:

Linux

@karel1980 karel1980 added the type-bug An unexpected behavior, bug, or error label Jan 30, 2025
@karel1980
Copy link
Author

I ended up running ./python -mtest -v test_datetime and got the results listed below.
Looks like the test_vilnius_1949_* tests fail with something date formatting related. I suspect I have to configure a locale somewhere. I'll keep looking


======================================================================
FAIL: test_vilnius_1941_fromutc (test.datetimetester.TestLocalTimeDisambiguation_Pure.test_vilnius_1941_fromutc)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/karel/Python-3.13.1/Lib/test/datetimetester.py", line 5808, in test_vilnius_1941_fromutc
    self.assertEqual(ldt.strftime("%c %Z%z"),
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
                     'Mon Jun 23 23:59:59 1941 MSK+0300')
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Mon 23 Jun 1941 23:59:59 CET MSK+0300' != 'Mon Jun 23 23:59:59 1941 MSK+0300'
- Mon 23 Jun 1941 23:59:59 CET MSK+0300
?     ---    ^^^^          ^^^
+ Mon Jun 23 23:59:59 1941 MSK+0300
?         ^^          ^^^^


======================================================================
FAIL: test_vilnius_1941_toutc (test.datetimetester.TestLocalTimeDisambiguation_Pure.test_vilnius_1941_toutc)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/karel/Python-3.13.1/Lib/test/datetimetester.py", line 5832, in test_vilnius_1941_toutc
    self.assertEqual(gdt.strftime("%c %Z"),
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
                     'Mon Jun 23 19:59:59 1941 UTC')
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Mon 23 Jun 1941 19:59:59  UTC' != 'Mon Jun 23 19:59:59 1941 UTC'
- Mon 23 Jun 1941 19:59:59  UTC
?     ---    ^^^^
+ Mon Jun 23 19:59:59 1941 UTC
?         ^^          ++++


======================================================================
FAIL: test_vilnius_1941_fromutc (test.datetimetester.TestLocalTimeDisambiguation_Fast.test_vilnius_1941_fromutc)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/karel/Python-3.13.1/Lib/test/datetimetester.py", line 5808, in test_vilnius_1941_fromutc
    self.assertEqual(ldt.strftime("%c %Z%z"),
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
                     'Mon Jun 23 23:59:59 1941 MSK+0300')
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Mon 23 Jun 1941 23:59:59 CET MSK+0300' != 'Mon Jun 23 23:59:59 1941 MSK+0300'
- Mon 23 Jun 1941 23:59:59 CET MSK+0300
?     ---    ^^^^          ^^^
+ Mon Jun 23 23:59:59 1941 MSK+0300
?         ^^          ^^^^


======================================================================
FAIL: test_vilnius_1941_toutc (test.datetimetester.TestLocalTimeDisambiguation_Fast.test_vilnius_1941_toutc)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/karel/Python-3.13.1/Lib/test/datetimetester.py", line 5832, in test_vilnius_1941_toutc
    self.assertEqual(gdt.strftime("%c %Z"),
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
                     'Mon Jun 23 19:59:59 1941 UTC')
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Mon 23 Jun 1941 19:59:59  UTC' != 'Mon Jun 23 19:59:59 1941 UTC'
- Mon 23 Jun 1941 19:59:59  UTC
?     ---    ^^^^
+ Mon Jun 23 19:59:59 1941 UTC
?         ^^          ++++


----------------------------------------------------------------------
Ran 1036 tests in 4.967s

FAILED (failures=4, skipped=31)
test test_datetime failed
test_datetime failed (4 failures)

== Tests result: FAILURE ==

1 test failed:
    test_datetime

Total duration: 5.1 sec
Total tests: run=1,036 failures=4 skipped=31
Total test files: run=1/1 failed=1
Result: FAILURE
karel@homeassistant:~/Python-3.13.1 $ 

@karel1980
Copy link
Author

Fixed by setting my locale to 'C'. It was set to en_GB.UTF-8
Command used to fix it: export LC_ALL=C

I feel like either I missed an instruction or it would be an improvement to the documentation if it's not there.
Let me know and I'll send a PR to add it to README.rst (or somewhere else if you prefer somewhere else)

@encukou encukou added the tests Tests in the Lib/test dir label Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants