huwwp / cryptop

command line crypto portfolio
MIT License
235 stars 41 forks source link

Getting locale error in Alpine docker container #53

Closed ncoder-1 closed 6 years ago

ncoder-1 commented 6 years ago

Hi,

I am getting the following error running cryptop from within an alpine docker container (frolvlad/alpine-python3):

ValueError: Currency formatting is not possible using the 'C' locale.

I've tried to override the environment variables with en_US.UTF-8 but no luck.

ghost commented 6 years ago

How does your .cryptop/config.ini look like?

Does it contain something like:

[locale]
monetary=de_CH.UTF-8

Also, double check what does locale command in your shell say:

 ~ locale
LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

With these settings and version v0.2.0, cryptop works for me in bash.

If it still doesn't work, it must be something to do with Alpine's Almquist shell (also called ash).

ncoder-1 commented 6 years ago

locale doesn't exist in the alpine docker I have.

I've added my locale in monetary inside config.ini and no luck. Must be the lack of locale in Alpine.

ghost commented 6 years ago

Perhaps this will help

ncoder-1 commented 6 years ago

It does, thanks!