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.

Title: _parse_localename fail to parse 'en_IL'
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.10
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: SilentGhost, andrei.avk, eryksun, hodai goldman, lemburg, mangrisano
Priority: normal Keywords: patch

Created on 2019-06-07 16:33 by hodai goldman, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 14027 closed hodai goldman, 2019-06-12 21:09
Messages (6)
msg344966 - (view) Author: hodai goldman (hodai goldman) * Date: 2019-06-07 16:33
_parse_localename fail to parse 'US_IL':

Traceback (most recent call last):
  File "/usr/bin/flowblade", line 78, in <module>
  File "/usr/share/flowblade/Flowblade/", line 194, in main
  File "/usr/share/flowblade/Flowblade/", line 39, in init_languages
    lc, encoding = locale.getdefaultlocale()
  File "/usr/lib/python2.7/", line 545, in getdefaultlocale
    return _parse_localename(localename)
  File "/usr/lib/python2.7/", line 477, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: en_IL

need to add another check for '_' separator, code:

    if '.' in code:
        return tuple(code.split('.')[:2])
msg344967 - (view) Author: Michele Angrisano (mangrisano) * Date: 2019-06-07 16:44
Hi Hodai, thank you for the report.
Would you be interested to propose a Pull Request for this issue?

You can read the devguide for more informations.

Thank you. :)
msg344968 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2019-06-07 16:45
How come your locale doesn't have encoding associated with it? The bit you're looking at is not really relevant, though.
msg345075 - (view) Author: hodai goldman (hodai goldman) * Date: 2019-06-09 08:21
hi Michele,
Yes i wold propose a Pull Request.
SilentGhost: I don't know.
msg397040 - (view) Author: Andrei Kulakov (andrei.avk) * (Python triager) Date: 2021-07-06 14:21
Note the traceback is from 2.7, which is not supported. Hodai: Can you verify it on a 3.6-3.11 release?
msg407642 - (view) Author: Andrei Kulakov (andrei.avk) * (Python triager) Date: 2021-12-04 06:50
I confirmed that it works on 3.9 so I think this can be closed as not a bug:

[ins] In [4]: _parse_localename('en_IL')
Out[4]: ('en_IL', 'UTF-8')
Date User Action Args
2022-04-11 14:59:16adminsetgithub: 81379
2021-12-04 09:39:30christian.heimessetstatus: open -> closed
resolution: out of date
stage: needs patch -> resolved
2021-12-04 06:50:30andrei.avksetmessages: + msg407642
2021-07-06 14:22:38andrei.avksetversions: + Python 3.10
2021-07-06 14:21:35andrei.avksetnosy: + andrei.avk

messages: + msg397040
versions: - Python 3.10
2021-02-23 13:47:44eryksunsetmessages: - msg345454
2020-05-28 23:50:57cheryl.sabellasetstage: patch review -> needs patch
versions: + Python 3.10, - Python 2.7
2019-06-13 03:46:02eryksunsetnosy: + eryksun
messages: + msg345454
2019-06-12 21:09:47hodai goldmansetkeywords: + patch
stage: patch review
pull_requests: + pull_request13891
2019-06-09 08:21:47hodai goldmansetmessages: + msg345075
2019-06-07 16:45:09SilentGhostsettitle: _parse_localename fail to parse 'US_IL' -> _parse_localename fail to parse 'en_IL'
nosy: + SilentGhost

messages: + msg344968

components: + Library (Lib)
type: crash -> behavior
2019-06-07 16:44:00mangrisanosetnosy: + mangrisano, lemburg
messages: + msg344967
2019-06-07 16:33:21hodai goldmancreate