[New-bugs-announce] [issue37198] _parse_localename fail to parse 'US_IL'

hodai goldman report at bugs.python.org
Fri Jun 7 12:33:21 EDT 2019


New submission from hodai goldman <hodaig at gmail.com>:

_parse_localename fail to parse 'US_IL':

Traceback (most recent call last):
  File "/usr/bin/flowblade", line 78, in <module>
    app.main(modules_path)
  File "/usr/share/flowblade/Flowblade/app.py", line 194, in main
    translations.init_languages()
  File "/usr/share/flowblade/Flowblade/translations.py", line 39, in init_languages
    lc, encoding = locale.getdefaultlocale()
  File "/usr/lib/python2.7/locale.py", line 545, in getdefaultlocale
    return _parse_localename(localename)
  File "/usr/lib/python2.7/locale.py", 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])

----------
messages: 344966
nosy: hodai goldman
priority: normal
severity: normal
status: open
title: _parse_localename fail to parse 'US_IL'
type: crash
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37198>
_______________________________________


More information about the New-bugs-announce mailing list