Skip to content

test_calendar and test_pdb always fail in non-English locale #130665

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

Closed
serhiy-storchaka opened this issue Feb 28, 2025 · 2 comments
Closed

test_calendar and test_pdb always fail in non-English locale #130665

serhiy-storchaka opened this issue Feb 28, 2025 · 2 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented Feb 28, 2025

Example of the test_calendar output for locale uk_UA.UTF-8:

======================================================================
FAIL: test_option_encoding (test.test_calendar.CommandLineTestCase.test_option_encoding)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_calendar.py", line 1035, in test_option_encoding
    self.assertEqual(output, result_2004_text.encode('utf-16-le'))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: b' \x[224 chars] \x00 \x00A\x04V\x04G\x04=\x04O\x04 \x00 \x00 [10163 chars]\x00' != b' \x[224 chars] \x00J\x00a\x00n\x00u\x00a\x00r\x00y\x00 \x00 [10163 chars]\x00'

======================================================================
FAIL: test_option_lines (test.test_calendar.CommandLineTestCase.test_option_lines)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_calendar.py", line 1074, in test_option_lines
    self.assertIn(conv('December\n\nMo Tu We'), output)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: b'December\n\nMo Tu We' not found in b'                                  2004\n\n\n\n       \xd1\x81\xd1\x96\xd1\x87\xd0\xbd\xd1\x8f                     \xd0\xbb\xd1\x8e\xd1\x82\xd0\xbe\xd0\xb3\xd0\xbe                   \xd0\xb1\xd0\xb5\xd1\x80\xd0\xb5\xd0\xb7\xd0\xbd\xd1\x8f\n\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4      \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4      \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n\n          1  2  3  4                         1       1  2  3  4  5  6  7\n\n 5  6  7  8  9 10 11       2  3  4  5  6  7  8       8  9 10 11 12 13 14\n\n12 13 14 15 16 17 18       9 10 11 12 13 14 15      15 16 17 18 19 20 21\n\n19 20 21 22 23 24 25      16 17 18 19 20 21 22      22 23 24 25 26 27 28\n\n26 27 28 29 30 31         23 24 25 26 27 28 29      29 30 31\n\n\n\n       \xd0\xba\xd0\xb2\xd1\x96\xd1\x82\xd0\xbd\xd1\x8f                    \xd1\x82\xd1\x80\xd0\xb0\xd0\xb2\xd0\xbd\xd1\x8f                    \xd1\x87\xd0\xb5\xd1\x80\xd0\xb2\xd0\xbd\xd1\x8f\n\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4      \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4      \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n\n          1  2  3  4                      1  2          1  2  3  4  5  6\n\n 5  6  7  8  9 10 11       3  4  5  6  7  8  9       7  8  9 10 11 12 13\n\n12 13 14 15 16 17 18      10 11 12 13 14 15 16      14 15 16 17 18 19 20\n\n19 20 21 22 23 24 25      17 18 19 20 21 22 23      21 22 23 24 25 26 27\n\n26 27 28 29 30            24 25 26 27 28 29 30      28 29 30\n\n                          31\n\n\n\n       \xd0\xbb\xd0\xb8\xd0\xbf\xd0\xbd\xd1\x8f                     \xd1\x81\xd0\xb5\xd1\x80\xd0\xbf\xd0\xbd\xd1\x8f                   \xd0\xb2\xd0\xb5\xd1\x80\xd0\xb5\xd1\x81\xd0\xbd\xd1\x8f\n\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4      \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4      \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n\n          1  2  3  4                         1             1  2  3  4  5\n\n 5  6  7  8  9 10 11       2  3  4  5  6  7  8       6  7  8  9 10 11 12\n\n12 13 14 15 16 17 18       9 10 11 12 13 14 15      13 14 15 16 17 18 19\n\n19 20 21 22 23 24 25      16 17 18 19 20 21 22      20 21 22 23 24 25 26\n\n26 27 28 29 30 31         23 24 25 26 27 28 29      27 28 29 30\n\n                          30 31\n\n\n\n       \xd0\xb6\xd0\xbe\xd0\xb2\xd1\x82\xd0\xbd\xd1\x8f                  \xd0\xbb\xd0\xb8\xd1\x81\xd1\x82\xd0\xbe\xd0\xbf\xd0\xb0\xd0\xb4\xd0\xb0                   \xd0\xb3\xd1\x80\xd1\x83\xd0\xb4\xd0\xbd\xd1\x8f\n\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4      \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4      \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n\n             1  2  3       1  2  3  4  5  6  7             1  2  3  4  5\n\n 4  5  6  7  8  9 10       8  9 10 11 12 13 14       6  7  8  9 10 11 12\n\n11 12 13 14 15 16 17      15 16 17 18 19 20 21      13 14 15 16 17 18 19\n\n18 19 20 21 22 23 24      22 23 24 25 26 27 28      20 21 22 23 24 25 26\n\n25 26 27 28 29 30 31      29 30                     27 28 29 30 31\n\n'

======================================================================
FAIL: test_option_months (test.test_calendar.CommandLineTestCase.test_option_months)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_calendar.py", line 1090, in test_option_months
    self.assertIn(conv('\nMo Tu We Th Fr Sa Su\n'), output)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: b'\nMo Tu We Th Fr Sa Su\n' not found in b'        2004\n\n       \xd1\x81\xd1\x96\xd1\x87\xd0\xbd\xd1\x8f\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n          1  2  3  4\n 5  6  7  8  9 10 11\n12 13 14 15 16 17 18\n19 20 21 22 23 24 25\n26 27 28 29 30 31\n\n       \xd0\xbb\xd1\x8e\xd1\x82\xd0\xbe\xd0\xb3\xd0\xbe\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n                   1\n 2  3  4  5  6  7  8\n 9 10 11 12 13 14 15\n16 17 18 19 20 21 22\n23 24 25 26 27 28 29\n\n      \xd0\xb1\xd0\xb5\xd1\x80\xd0\xb5\xd0\xb7\xd0\xbd\xd1\x8f\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n 1  2  3  4  5  6  7\n 8  9 10 11 12 13 14\n15 16 17 18 19 20 21\n22 23 24 25 26 27 28\n29 30 31\n\n       \xd0\xba\xd0\xb2\xd1\x96\xd1\x82\xd0\xbd\xd1\x8f\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n          1  2  3  4\n 5  6  7  8  9 10 11\n12 13 14 15 16 17 18\n19 20 21 22 23 24 25\n26 27 28 29 30\n\n       \xd1\x82\xd1\x80\xd0\xb0\xd0\xb2\xd0\xbd\xd1\x8f\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n                1  2\n 3  4  5  6  7  8  9\n10 11 12 13 14 15 16\n17 18 19 20 21 22 23\n24 25 26 27 28 29 30\n31\n\n       \xd1\x87\xd0\xb5\xd1\x80\xd0\xb2\xd0\xbd\xd1\x8f\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n    1  2  3  4  5  6\n 7  8  9 10 11 12 13\n14 15 16 17 18 19 20\n21 22 23 24 25 26 27\n28 29 30\n\n       \xd0\xbb\xd0\xb8\xd0\xbf\xd0\xbd\xd1\x8f\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n          1  2  3  4\n 5  6  7  8  9 10 11\n12 13 14 15 16 17 18\n19 20 21 22 23 24 25\n26 27 28 29 30 31\n\n       \xd1\x81\xd0\xb5\xd1\x80\xd0\xbf\xd0\xbd\xd1\x8f\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n                   1\n 2  3  4  5  6  7  8\n 9 10 11 12 13 14 15\n16 17 18 19 20 21 22\n23 24 25 26 27 28 29\n30 31\n\n      \xd0\xb2\xd0\xb5\xd1\x80\xd0\xb5\xd1\x81\xd0\xbd\xd1\x8f\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n       1  2  3  4  5\n 6  7  8  9 10 11 12\n13 14 15 16 17 18 19\n20 21 22 23 24 25 26\n27 28 29 30\n\n       \xd0\xb6\xd0\xbe\xd0\xb2\xd1\x82\xd0\xbd\xd1\x8f\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n             1  2  3\n 4  5  6  7  8  9 10\n11 12 13 14 15 16 17\n18 19 20 21 22 23 24\n25 26 27 28 29 30 31\n\n     \xd0\xbb\xd0\xb8\xd1\x81\xd1\x82\xd0\xbe\xd0\xbf\xd0\xb0\xd0\xb4\xd0\xb0\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n 1  2  3  4  5  6  7\n 8  9 10 11 12 13 14\n15 16 17 18 19 20 21\n22 23 24 25 26 27 28\n29 30\n\n       \xd0\xb3\xd1\x80\xd1\x83\xd0\xb4\xd0\xbd\xd1\x8f\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n       1  2  3  4  5\n 6  7  8  9 10 11 12\n13 14 15 16 17 18 19\n20 21 22 23 24 25 26\n27 28 29 30 31\n'

======================================================================
FAIL: test_option_spacing (test.test_calendar.CommandLineTestCase.test_option_spacing)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_calendar.py", line 1082, in test_option_spacing
    self.assertIn(b'Su        Mo', output)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: b'Su        Mo' not found in b'                                    2004\n\n       \xd1\x81\xd1\x96\xd1\x87\xd0\xbd\xd1\x8f                       \xd0\xbb\xd1\x8e\xd1\x82\xd0\xbe\xd0\xb3\xd0\xbe                     \xd0\xb1\xd0\xb5\xd1\x80\xd0\xb5\xd0\xb7\xd0\xbd\xd1\x8f\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4        \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4        \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n          1  2  3  4                           1         1  2  3  4  5  6  7\n 5  6  7  8  9 10 11         2  3  4  5  6  7  8         8  9 10 11 12 13 14\n12 13 14 15 16 17 18         9 10 11 12 13 14 15        15 16 17 18 19 20 21\n19 20 21 22 23 24 25        16 17 18 19 20 21 22        22 23 24 25 26 27 28\n26 27 28 29 30 31           23 24 25 26 27 28 29        29 30 31\n\n       \xd0\xba\xd0\xb2\xd1\x96\xd1\x82\xd0\xbd\xd1\x8f                      \xd1\x82\xd1\x80\xd0\xb0\xd0\xb2\xd0\xbd\xd1\x8f                      \xd1\x87\xd0\xb5\xd1\x80\xd0\xb2\xd0\xbd\xd1\x8f\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4        \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4        \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n          1  2  3  4                        1  2            1  2  3  4  5  6\n 5  6  7  8  9 10 11         3  4  5  6  7  8  9         7  8  9 10 11 12 13\n12 13 14 15 16 17 18        10 11 12 13 14 15 16        14 15 16 17 18 19 20\n19 20 21 22 23 24 25        17 18 19 20 21 22 23        21 22 23 24 25 26 27\n26 27 28 29 30              24 25 26 27 28 29 30        28 29 30\n                            31\n\n       \xd0\xbb\xd0\xb8\xd0\xbf\xd0\xbd\xd1\x8f                       \xd1\x81\xd0\xb5\xd1\x80\xd0\xbf\xd0\xbd\xd1\x8f                     \xd0\xb2\xd0\xb5\xd1\x80\xd0\xb5\xd1\x81\xd0\xbd\xd1\x8f\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4        \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4        \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n          1  2  3  4                           1               1  2  3  4  5\n 5  6  7  8  9 10 11         2  3  4  5  6  7  8         6  7  8  9 10 11 12\n12 13 14 15 16 17 18         9 10 11 12 13 14 15        13 14 15 16 17 18 19\n19 20 21 22 23 24 25        16 17 18 19 20 21 22        20 21 22 23 24 25 26\n26 27 28 29 30 31           23 24 25 26 27 28 29        27 28 29 30\n                            30 31\n\n       \xd0\xb6\xd0\xbe\xd0\xb2\xd1\x82\xd0\xbd\xd1\x8f                    \xd0\xbb\xd0\xb8\xd1\x81\xd1\x82\xd0\xbe\xd0\xbf\xd0\xb0\xd0\xb4\xd0\xb0                     \xd0\xb3\xd1\x80\xd1\x83\xd0\xb4\xd0\xbd\xd1\x8f\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4        \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4        \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n             1  2  3         1  2  3  4  5  6  7               1  2  3  4  5\n 4  5  6  7  8  9 10         8  9 10 11 12 13 14         6  7  8  9 10 11 12\n11 12 13 14 15 16 17        15 16 17 18 19 20 21        13 14 15 16 17 18 19\n18 19 20 21 22 23 24        22 23 24 25 26 27 28        20 21 22 23 24 25 26\n25 26 27 28 29 30 31        29 30                       27 28 29 30 31\n'

======================================================================
FAIL: test_option_type (test.test_calendar.CommandLineTestCase.test_option_type)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_calendar.py", line 1098, in test_option_type
    self.assertEqual(output, conv(result_2004_text))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: b'   [40 chars]      \xd1\x81\xd1\x96\xd1\x87\xd0\xbd\xd1\x8f[3724 chars]31\n' != b'   [40 chars]     January                   February       [2023 chars]31\n'

======================================================================
FAIL: test_option_width (test.test_calendar.CommandLineTestCase.test_option_width)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_calendar.py", line 1066, in test_option_width
    self.assertIn(b'Mon Tue Wed Thu Fri Sat Sun', output)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: b'Mon Tue Wed Thu Fri Sat Sun' not found in b'                                             2004\n\n           \xd1\x81\xd1\x96\xd1\x87\xd0\xbd\xd1\x8f                            \xd0\xbb\xd1\x8e\xd1\x82\xd0\xbe\xd0\xb3\xd0\xbe                          \xd0\xb1\xd0\xb5\xd1\x80\xd0\xb5\xd0\xb7\xd0\xbd\xd1\x8f\n \xd0\xbf\xd0\xbd  \xd0\xb2\xd1\x82  \xd1\x81\xd1\x80  \xd1\x87\xd1\x82  \xd0\xbf\xd1\x82  \xd1\x81\xd0\xb1  \xd0\xbd\xd0\xb4       \xd0\xbf\xd0\xbd  \xd0\xb2\xd1\x82  \xd1\x81\xd1\x80  \xd1\x87\xd1\x82  \xd0\xbf\xd1\x82  \xd1\x81\xd0\xb1  \xd0\xbd\xd0\xb4       \xd0\xbf\xd0\xbd  \xd0\xb2\xd1\x82  \xd1\x81\xd1\x80  \xd1\x87\xd1\x82  \xd0\xbf\xd1\x82  \xd1\x81\xd0\xb1  \xd0\xbd\xd0\xb4\n              1   2   3   4                                1        1   2   3   4   5   6   7\n  5   6   7   8   9  10  11        2   3   4   5   6   7   8        8   9  10  11  12  13  14\n 12  13  14  15  16  17  18        9  10  11  12  13  14  15       15  16  17  18  19  20  21\n 19  20  21  22  23  24  25       16  17  18  19  20  21  22       22  23  24  25  26  27  28\n 26  27  28  29  30  31           23  24  25  26  27  28  29       29  30  31\n\n           \xd0\xba\xd0\xb2\xd1\x96\xd1\x82\xd0\xbd\xd1\x8f                           \xd1\x82\xd1\x80\xd0\xb0\xd0\xb2\xd0\xbd\xd1\x8f                           \xd1\x87\xd0\xb5\xd1\x80\xd0\xb2\xd0\xbd\xd1\x8f\n \xd0\xbf\xd0\xbd  \xd0\xb2\xd1\x82  \xd1\x81\xd1\x80  \xd1\x87\xd1\x82  \xd0\xbf\xd1\x82  \xd1\x81\xd0\xb1  \xd0\xbd\xd0\xb4       \xd0\xbf\xd0\xbd  \xd0\xb2\xd1\x82  \xd1\x81\xd1\x80  \xd1\x87\xd1\x82  \xd0\xbf\xd1\x82  \xd1\x81\xd0\xb1  \xd0\xbd\xd0\xb4       \xd0\xbf\xd0\xbd  \xd0\xb2\xd1\x82  \xd1\x81\xd1\x80  \xd1\x87\xd1\x82  \xd0\xbf\xd1\x82  \xd1\x81\xd0\xb1  \xd0\xbd\xd0\xb4\n              1   2   3   4                            1   2            1   2   3   4   5   6\n  5   6   7   8   9  10  11        3   4   5   6   7   8   9        7   8   9  10  11  12  13\n 12  13  14  15  16  17  18       10  11  12  13  14  15  16       14  15  16  17  18  19  20\n 19  20  21  22  23  24  25       17  18  19  20  21  22  23       21  22  23  24  25  26  27\n 26  27  28  29  30               24  25  26  27  28  29  30       28  29  30\n                                  31\n\n           \xd0\xbb\xd0\xb8\xd0\xbf\xd0\xbd\xd1\x8f                            \xd1\x81\xd0\xb5\xd1\x80\xd0\xbf\xd0\xbd\xd1\x8f                          \xd0\xb2\xd0\xb5\xd1\x80\xd0\xb5\xd1\x81\xd0\xbd\xd1\x8f\n \xd0\xbf\xd0\xbd  \xd0\xb2\xd1\x82  \xd1\x81\xd1\x80  \xd1\x87\xd1\x82  \xd0\xbf\xd1\x82  \xd1\x81\xd0\xb1  \xd0\xbd\xd0\xb4       \xd0\xbf\xd0\xbd  \xd0\xb2\xd1\x82  \xd1\x81\xd1\x80  \xd1\x87\xd1\x82  \xd0\xbf\xd1\x82  \xd1\x81\xd0\xb1  \xd0\xbd\xd0\xb4       \xd0\xbf\xd0\xbd  \xd0\xb2\xd1\x82  \xd1\x81\xd1\x80  \xd1\x87\xd1\x82  \xd0\xbf\xd1\x82  \xd1\x81\xd0\xb1  \xd0\xbd\xd0\xb4\n              1   2   3   4                                1                1   2   3   4   5\n  5   6   7   8   9  10  11        2   3   4   5   6   7   8        6   7   8   9  10  11  12\n 12  13  14  15  16  17  18        9  10  11  12  13  14  15       13  14  15  16  17  18  19\n 19  20  21  22  23  24  25       16  17  18  19  20  21  22       20  21  22  23  24  25  26\n 26  27  28  29  30  31           23  24  25  26  27  28  29       27  28  29  30\n                                  30  31\n\n           \xd0\xb6\xd0\xbe\xd0\xb2\xd1\x82\xd0\xbd\xd1\x8f                         \xd0\xbb\xd0\xb8\xd1\x81\xd1\x82\xd0\xbe\xd0\xbf\xd0\xb0\xd0\xb4\xd0\xb0                          \xd0\xb3\xd1\x80\xd1\x83\xd0\xb4\xd0\xbd\xd1\x8f\n \xd0\xbf\xd0\xbd  \xd0\xb2\xd1\x82  \xd1\x81\xd1\x80  \xd1\x87\xd1\x82  \xd0\xbf\xd1\x82  \xd1\x81\xd0\xb1  \xd0\xbd\xd0\xb4       \xd0\xbf\xd0\xbd  \xd0\xb2\xd1\x82  \xd1\x81\xd1\x80  \xd1\x87\xd1\x82  \xd0\xbf\xd1\x82  \xd1\x81\xd0\xb1  \xd0\xbd\xd0\xb4       \xd0\xbf\xd0\xbd  \xd0\xb2\xd1\x82  \xd1\x81\xd1\x80  \xd1\x87\xd1\x82  \xd0\xbf\xd1\x82  \xd1\x81\xd0\xb1  \xd0\xbd\xd0\xb4\n                  1   2   3        1   2   3   4   5   6   7                1   2   3   4   5\n  4   5   6   7   8   9  10        8   9  10  11  12  13  14        6   7   8   9  10  11  12\n 11  12  13  14  15  16  17       15  16  17  18  19  20  21       13  14  15  16  17  18  19\n 18  19  20  21  22  23  24       22  23  24  25  26  27  28       20  21  22  23  24  25  26\n 25  26  27  28  29  30  31       29  30                           27  28  29  30  31\n'

======================================================================
FAIL: test_output_current_year (test.test_calendar.CommandLineTestCase.test_output_current_year)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_calendar.py", line 1017, in test_output_current_year
    self.assertIn(b'January', output)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
AssertionError: b'January' not found in b'                                  2025\n\n       \xd1\x81\xd1\x96\xd1\x87\xd0\xbd\xd1\x8f                     \xd0\xbb\xd1\x8e\xd1\x82\xd0\xbe\xd0\xb3\xd0\xbe                   \xd0\xb1\xd0\xb5\xd1\x80\xd0\xb5\xd0\xb7\xd0\xbd\xd1\x8f\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4      \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4      \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n       1  2  3  4  5                      1  2                      1  2\n 6  7  8  9 10 11 12       3  4  5  6  7  8  9       3  4  5  6  7  8  9\n13 14 15 16 17 18 19      10 11 12 13 14 15 16      10 11 12 13 14 15 16\n20 21 22 23 24 25 26      17 18 19 20 21 22 23      17 18 19 20 21 22 23\n27 28 29 30 31            24 25 26 27 28            24 25 26 27 28 29 30\n                                                    31\n\n       \xd0\xba\xd0\xb2\xd1\x96\xd1\x82\xd0\xbd\xd1\x8f                    \xd1\x82\xd1\x80\xd0\xb0\xd0\xb2\xd0\xbd\xd1\x8f                    \xd1\x87\xd0\xb5\xd1\x80\xd0\xb2\xd0\xbd\xd1\x8f\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4      \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4      \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n    1  2  3  4  5  6                1  2  3  4                         1\n 7  8  9 10 11 12 13       5  6  7  8  9 10 11       2  3  4  5  6  7  8\n14 15 16 17 18 19 20      12 13 14 15 16 17 18       9 10 11 12 13 14 15\n21 22 23 24 25 26 27      19 20 21 22 23 24 25      16 17 18 19 20 21 22\n28 29 30                  26 27 28 29 30 31         23 24 25 26 27 28 29\n                                                    30\n\n       \xd0\xbb\xd0\xb8\xd0\xbf\xd0\xbd\xd1\x8f                     \xd1\x81\xd0\xb5\xd1\x80\xd0\xbf\xd0\xbd\xd1\x8f                   \xd0\xb2\xd0\xb5\xd1\x80\xd0\xb5\xd1\x81\xd0\xbd\xd1\x8f\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4      \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4      \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n    1  2  3  4  5  6                   1  2  3       1  2  3  4  5  6  7\n 7  8  9 10 11 12 13       4  5  6  7  8  9 10       8  9 10 11 12 13 14\n14 15 16 17 18 19 20      11 12 13 14 15 16 17      15 16 17 18 19 20 21\n21 22 23 24 25 26 27      18 19 20 21 22 23 24      22 23 24 25 26 27 28\n28 29 30 31               25 26 27 28 29 30 31      29 30\n\n       \xd0\xb6\xd0\xbe\xd0\xb2\xd1\x82\xd0\xbd\xd1\x8f                  \xd0\xbb\xd0\xb8\xd1\x81\xd1\x82\xd0\xbe\xd0\xbf\xd0\xb0\xd0\xb4\xd0\xb0                   \xd0\xb3\xd1\x80\xd1\x83\xd0\xb4\xd0\xbd\xd1\x8f\n\xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4      \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4      \xd0\xbf\xd0\xbd \xd0\xb2\xd1\x82 \xd1\x81\xd1\x80 \xd1\x87\xd1\x82 \xd0\xbf\xd1\x82 \xd1\x81\xd0\xb1 \xd0\xbd\xd0\xb4\n       1  2  3  4  5                      1  2       1  2  3  4  5  6  7\n 6  7  8  9 10 11 12       3  4  5  6  7  8  9       8  9 10 11 12 13 14\n13 14 15 16 17 18 19      10 11 12 13 14 15 16      15 16 17 18 19 20 21\n20 21 22 23 24 25 26      17 18 19 20 21 22 23      22 23 24 25 26 27 28\n27 28 29 30 31            24 25 26 27 28 29 30      29 30 31\n'

======================================================================
FAIL: test_output_month (test.test_calendar.CommandLineTestCase.test_output_month)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_calendar.py", line 1028, in test_output_month
    self.assertEqual(output, conv(result_2004_01_text))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: b'     \xd1\x81\xd1\x96\xd1\x87\xd0\xbd\xd1\x8f[230 chars]31\n' != b'    January 2004\nMo Tu We Th Fr Sa Su\n     [98 chars]31\n'

======================================================================
FAIL: test_output_year (test.test_calendar.CommandLineTestCase.test_output_year)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_calendar.py", line 1023, in test_output_year
    self.assertEqual(output, conv(result_2004_text))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: b'   [40 chars]      \xd1\x81\xd1\x96\xd1\x87\xd0\xbd\xd1\x8f[3724 chars]31\n' != b'   [40 chars]     January                   February       [2023 chars]31\n'

----------------------------------------------------------------------

test_pdb also fails, because it uses the calendar module:

======================================================================
FAIL: test_run_module_with_args (test.test_pdb.PdbTestCase.test_run_module_with_args)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_pdb.py", line 3696, in test_run_module_with_args
    self.assertIn("December", stdout)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
AssertionError: 'December' not found in '> /home/serhiy/py/cpython/Lib/calendar.py(1)<module>()\n-> """Calendar printing functions\n(Pdb) (Pdb)                                    1\n\n       січня                     лютого                   березня\nпн вт ср чт пт сб нд      пн вт ср чт пт сб нд      пн вт ср чт пт сб нд\n 1  2  3  4  5  6  7                1  2  3  4                1  2  3  4\n 8  9 10 11 12 13 14       5  6  7  8  9 10 11       5  6  7  8  9 10 11\n15 16 17 18 19 20 21      12 13 14 15 16 17 18      12 13 14 15 16 17 18\n22 23 24 25 26 27 28      19 20 21 22 23 24 25      19 20 21 22 23 24 25\n29 30 31                  26 27 28                  26 27 28 29 30 31\n\n       квітня                    травня                    червня\nпн вт ср чт пт сб нд      пн вт ср чт пт сб нд      пн вт ср чт пт сб нд\n                   1          1  2  3  4  5  6                   1  2  3\n 2  3  4  5  6  7  8       7  8  9 10 11 12 13       4  5  6  7  8  9 10\n 9 10 11 12 13 14 15      14 15 16 17 18 19 20      11 12 13 14 15 16 17\n16 17 18 19 20 21 22      21 22 23 24 25 26 27      18 19 20 21 22 23 24\n23 24 25 26 27 28 29      28 29 30 31               25 26 27 28 29 30\n30\n\n       липня                     серпня                   вересня\nпн вт ср чт пт сб нд      пн вт ср чт пт сб нд      пн вт ср чт пт сб нд\n                   1             1  2  3  4  5                      1  2\n 2  3  4  5  6  7  8       6  7  8  9 10 11 12       3  4  5  6  7  8  9\n 9 10 11 12 13 14 15      13 14 15 16 17 18 19      10 11 12 13 14 15 16\n16 17 18 19 20 21 22      20 21 22 23 24 25 26      17 18 19 20 21 22 23\n23 24 25 26 27 28 29      27 28 29 30 31            24 25 26 27 28 29 30\n30 31\n\n       жовтня                  листопада                   грудня\nпн вт ср чт пт сб нд      пн вт ср чт пт сб нд      пн вт ср чт пт сб нд\n 1  2  3  4  5  6  7                1  2  3  4                      1  2\n 8  9 10 11 12 13 14       5  6  7  8  9 10 11       3  4  5  6  7  8  9\n15 16 17 18 19 20 21      12 13 14 15 16 17 18      10 11 12 13 14 15 16\n22 23 24 25 26 27 28      19 20 21 22 23 24 25      17 18 19 20 21 22 23\n29 30 31                  26 27 28 29 30            24 25 26 27 28 29 30\n                                                    31\nThe program finished and will be restarted\n> /home/serhiy/py/cpython/Lib/calendar.py(1)<module>()\n-> """Calendar printing functions\n(Pdb)                                    1\n\n       січня                     лютого                   березня\nпн вт ср чт пт сб нд      пн вт ср чт пт сб нд      пн вт ср чт пт сб нд\n 1  2  3  4  5  6  7                1  2  3  4                1  2  3  4\n 8  9 10 11 12 13 14       5  6  7  8  9 10 11       5  6  7  8  9 10 11\n15 16 17 18 19 20 21      12 13 14 15 16 17 18      12 13 14 15 16 17 18\n22 23 24 25 26 27 28      19 20 21 22 23 24 25      19 20 21 22 23 24 25\n29 30 31                  26 27 28                  26 27 28 29 30 31\n\n       квітня                    травня                    червня\nпн вт ср чт пт сб нд      пн вт ср чт пт сб нд      пн вт ср чт пт сб нд\n                   1          1  2  3  4  5  6                   1  2  3\n 2  3  4  5  6  7  8       7  8  9 10 11 12 13       4  5  6  7  8  9 10\n 9 10 11 12 13 14 15      14 15 16 17 18 19 20      11 12 13 14 15 16 17\n16 17 18 19 20 21 22      21 22 23 24 25 26 27      18 19 20 21 22 23 24\n23 24 25 26 27 28 29      28 29 30 31               25 26 27 28 29 30\n30\n\n       липня                     серпня                   вересня\nпн вт ср чт пт сб нд      пн вт ср чт пт сб нд      пн вт ср чт пт сб нд\n                   1             1  2  3  4  5                      1  2\n 2  3  4  5  6  7  8       6  7  8  9 10 11 12       3  4  5  6  7  8  9\n 9 10 11 12 13 14 15      13 14 15 16 17 18 19      10 11 12 13 14 15 16\n16 17 18 19 20 21 22      20 21 22 23 24 25 26      17 18 19 20 21 22 23\n23 24 25 26 27 28 29      27 28 29 30 31            24 25 26 27 28 29 30\n30 31\n\n       жовтня                  листопада                   грудня\nпн вт ср чт пт сб нд      пн вт ср чт пт сб нд      пн вт ср чт пт сб нд\n 1  2  3  4  5  6  7                1  2  3  4                      1  2\n 8  9 10 11 12 13 14       5  6  7  8  9 10 11       3  4  5  6  7  8  9\n15 16 17 18 19 20 21      12 13 14 15 16 17 18      10 11 12 13 14 15 16\n22 23 24 25 26 27 28      19 20 21 22 23 24 25      17 18 19 20 21 22 23\n29 30 31                  26 27 28 29 30            24 25 26 27 28 29 30\n                                                    31\nThe program finished and will be restarted\n> /home/serhiy/py/cpython/Lib/calendar.py(1)<module>()\n-> """Calendar printing functions\n(Pdb) \n'

----------------------------------------------------------------------

This is caused by #128317. Reverting that change fixes tests.

cc @hugovk

Linked PRs

@hugovk
Copy link
Member

hugovk commented Feb 28, 2025

Thanks for the report. Specifically caused by PR #129625.

Before, we'd get the month/day names in English, despite the env var:

LANG=uk_UA.UTF-8 python3.13 -m calendar 2025 2
   February 2025
Mo Tu We Th Fr Sa Su
                1  2
 3  4  5  6  7  8  9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28

It's because options.locale is not set (via --locale), so we used cal = TextCalendar().

TextCalendar is a subclass of the base Calendar class.

Now, we get this:

LANG=uk_UA.UTF-8 ./python.exe -m calendar 2025 2
    лютого 2025
пн вт ср чт пт сб нд
                1  2
 3  4  5  6  7  8  9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28

This is because options.locale is still not set, we use the new cal = _CLIDemoCalendar(highlight_day=today).

However, _CLIDemoCalendar is a subclass of LocaleTextCalendar (itself a subclass of TextCalendar).

Before, we only used LocaleTextCalendar when options.locale is set.

But now LocaleTextCalendar sets the locale from the env var, and we get local month/day names.

@hugovk
Copy link
Member

hugovk commented Feb 28, 2025

Please see PR #130676.

@hugovk hugovk added the type-bug An unexpected behavior, bug, or error label Feb 28, 2025
hugovk added a commit that referenced this issue Feb 28, 2025
@hugovk hugovk closed this as completed Feb 28, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in Locale issues 🗺 Feb 28, 2025
seehwan pushed a commit to seehwan/cpython that referenced this issue Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
Development

No branches or pull requests

3 participants