Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #98911
| From | Nagy László Zsolt <gandalf@shopzeus.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | pybabel: default locale is None ??? |
| Date | 2015-11-17 09:24 +0100 |
| Message-ID | <mailman.378.1447748690.16136.python-list@python.org> (permalink) |
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64
bit (AMD64)] on win32
>>> from datetime import timedelta
>>> from babel.dates import format_timedelta
>>> td = timedelta(seconds=39.28355172422679)
>>> format_timedelta(td)
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Python35\lib\site-packages\babel\dates.py", line 779, in
format_timedelta
plural_form = locale.plural_form(value)
AttributeError: 'NoneType' object has no attribute 'plural_form'
>>> from babel.core import default_locale
>>> repr(default_locale('LC_CTIME'))
'None'
Why? The default_locale documentation tells this:
"Returns the system default locale for a given category, based on
environment variables."
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
pybabel: default locale is None ??? Nagy László Zsolt <gandalf@shopzeus.com> - 2015-11-17 09:24 +0100
csiph-web