I would guess that your RPi does not have a  default locale set. To see
what locales it has been set to, use a simple "locale" command. Here's what
I get:

pi@RPi-bug ~ $ *locale*
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

The easiest way to set a default locale is to use dpkg-reconfigure:

$ *sudo dpkg-reconfigure locales*

-tk

On Mon, Jun 3, 2019 at 7:14 AM Chris Richmond <tomny...@frontier.com> wrote:

> I'm sure this is simply, but I'm setting up a new RPi for a VantageVue and
> tweaking extensions.py to check for good time.
> When I ran this stand-alone, locale.setlocale(locale.LC_ALL, '') failed.
>
> pi2c_/home/weewx/bin/user> python
> Python 2.7.13 (default, Sep 26 2018, 18:42:22)
> [GCC 6.3.0 20170516] on linux2
> >>> import locale
> >>> locale.setlocale(locale.LC_ALL, '')
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/lib/python2.7/locale.py", line 581, in setlocale
>     return _setlocale(category, locale)
> locale.Error: unsupported locale setting
> >>> locale.setlocale(locale.LC_ALL, 'C')
> 'C'
> >>>
>
> And from searching:
> pi2c_/home/weewx/bin/user> locale -a
> locale: Cannot set LC_CTYPE to default locale: No such file or directory
> locale: Cannot set LC_MESSAGES to default locale: No such file or directory
> locale: Cannot set LC_COLLATE to default locale: No such file or directory
> C
> C.UTF-8
> POSIX
> en_US.utf8
>
> So something is missing from the RPi itself that causes a weewxd failure.
> Setting the value to 'C' does work, but an empty string does not.  I had
> other
> wierd redraw problems with vim of all things and ended up with these in my
> .cshrc:
> setenv LANG ASCII
> setenv LC_ALL ASCII
> setenv LANGUAGE ASCII
>
> Chris
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to weewx-user+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/3f955101-2645-4c59-a858-b996ba61c087%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/3f955101-2645-4c59-a858-b996ba61c087%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEAsLtQSD_hU7SoZsh8Tgt2ZZEJLC3ZKRK_yiWv7Vv4KRg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to