Title: _parse_localename fail to parse 'en_IL'
Type: behavior Stage: needs patch
Components: Library (Lib) Versions: Python 3.10
Status: open Resolution:
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 2021-07-06 14:22 by andrei.avk.

Pull Requests
URL Status Linked Edit
PR 14027 closed hodai goldman, 2019-06-12 21:09
Messages (5)
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?
Date User Action Args
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