Odd locale error that has disappeared on reboot.

Dieter Maurer dieter at handshake.de
Wed Dec 8 13:02:01 EST 2021


Chris Green wrote at 2021-12-7 15:28 +0000:
>I have a very short Python program that runs on one of my Raspberry
>Pis to collect temperatures from a 1-wire sensor and write them to a
>database:-
> ...
>At 03:40 last night it suddenly started throwing the following error every
>time it ran:-
>
>    Fatal Python error: initfsencoding: Unable to get the locale encoding
>    LookupError: unknown encoding: UTF-8
>
>    Current thread 0xb6f8db40 (most recent call first):
>    Aborted
>
>Running the program from the command line produced the same error.
>Restarting the Pi system has fixed the problem.

Python has not its own locale database but uses that of the operating
system. From my point of view, the operating system state seems
to have got corrupted. A restart apparently has ensured a clean state again.


More information about the Python-list mailing list