Skip to content

Conversation

@raphiz
Copy link

@raphiz raphiz commented Oct 28, 2020

Hi 👋

I had an issue when using this module because some of my target systems do not have the en_US locale installed.
This issue also exists when using the python docker image, which also does not have this locale installed by default.

$ docker run --rm python:3.8.3 python -c "import locale; locale.setlocale(locale.LC_ALL, ('en_US', 'utf-8'))"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.8/locale.py", line 608, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

As a workaround, I suggest to generate the timestamp manually. This is more portable and more explicit.

This allows us to write tests easily
When using locale, the system must have the en_US locale
installed. This is quite often the case, for example in the
python docker image.
@delijati
Copy link

Uhh yes can this be merged ... i had that issue on my raspberry pi where the only installed lang was en_GB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants