Skip to content

test_format.py failed on test_locale if LC_ALL is not set #4970

Description

@qingshi163

The following error message comes when running test_format.py

I checked my enviroment that LC_ALL is not set, if I set it than the code will success.

======================================================================
FAIL: test_locale (__main__.FormatTest.test_locale)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_format.py", line 446, in test_locale
    locale.setlocale(locale.LC_ALL, oldloc)
  File "Lib/test/test_format.py", line 444, in test_locale
    self.assertEqual(text.replace(sep, ''), '1234' + point + '5')
  File "Lib/test/test_format.py", line 437, in test_locale
    self.assertIn(sep, text)
AssertionError: ',' not found in '123456789'

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

Activity

  1. DimitrisJim commented on May 15, 2023

    @DimitrisJim
    Member

    Should be duplicate of #4613 since this also appears to fail due to the format(123456789, "n") call.

  2. youknowone commented on Oct 6, 2026

    @youknowone
    Member

    The originally reported problem no longer reproduces on current main. Closing per the recheck in #8982.

    — commented by Grok 4.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions