This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_calendar and test_re fail with unknown locale: UTF-8 in _parse_localename
Type: behavior Stage: resolved
Components: Library (Lib), macOS Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, lemburg, matrixise, ned.deily, ronaldoussoren, serhiy.storchaka, vishalsingh
Priority: normal Keywords:

Created on 2018-02-01 09:10 by vishalsingh, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg311407 - (view) Author: Vishal Kushwaha (vishalsingh) Date: 2018-02-01 09:10
Fresh build on MacOS 10.13.2

======================================================================
ERROR: test_locale_flag (test.test_re.ReTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/vikramsingh/Desktop/projects/cpython/Lib/test/test_re.py", line 1520, in test_locale_flag
    _, enc = locale.getlocale(locale.LC_CTYPE)
  File "/Users/vikramsingh/Desktop/projects/cpython/Lib/locale.py", line 587, in getlocale
    return _parse_localename(localename)
  File "/Users/vikramsingh/Desktop/projects/cpython/Lib/locale.py", line 495, in _parse_localename
    raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: UTF-8

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

======================================================================
ERROR: test_option_locale (test.test_calendar.CommandLineTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/vikramsingh/Desktop/projects/cpython/Lib/test/test_calendar.py", line 838, in test_option_locale
    lang, enc = locale.getdefaultlocale()
  File "/Users/vikramsingh/Desktop/projects/cpython/Lib/locale.py", line 568, in getdefaultlocale
    return _parse_localename(localename)
  File "/Users/vikramsingh/Desktop/projects/cpython/Lib/locale.py", line 495, in _parse_localename
    raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: UTF-8

----------------------------------------------------------------------
msg311409 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2018-02-01 09:30
Could you dump your locales ?
LC_ALL & LANG, etc... ?

Thank you
msg311411 - (view) Author: Vishal Kushwaha (vishalsingh) Date: 2018-02-01 09:44
I'm new to this so I guess you were asking for this:
$ locale
LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=
msg311412 - (view) Author: Vishal Kushwaha (vishalsingh) Date: 2018-02-01 09:51
Ok It's a strange MacOs prob. closed. Thanks anyways :)
History
Date User Action Args
2022-04-11 14:58:57adminsetgithub: 76921
2018-02-01 09:51:48vishalsinghsetstatus: open -> closed

messages: + msg311412
stage: resolved
2018-02-01 09:44:01vishalsinghsetmessages: + msg311411
2018-02-01 09:30:47matrixisesetnosy: + matrixise
messages: + msg311409
2018-02-01 09:22:38serhiy.storchakasetnosy: + lemburg, ronaldoussoren, benjamin.peterson, ned.deily, serhiy.storchaka

components: + macOS
versions: + Python 3.6, Python 3.7
2018-02-01 09:10:58vishalsinghcreate