Odd locale error that has disappeared on reboot.

Chris Green cl at isbd.net
Thu Dec 9 05:42:48 EST 2021


Inada Naoki <songofacandy at gmail.com> wrote:
> On Wed, Dec 8, 2021 at 2:52 AM Chris Green <cl at isbd.net> wrote:
> >
> >
> > 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.
> >
> 
> This error means Python can not find its standard libraries. There are
> some possibilities.
> 
> * You set the wrong PYTHONHOME
>   PYTHONHOME is very rarely useful. It shouldn't be used if you can
> not solve this kind of problem.
> 
> * Your Python installation is broken.
>   Some files are deleted or overwritten. You need to *clean* install
> Python again.
> 
So how was it that rebooting the system fixed the error?  It has been
working perfectly OK now for a few days since the above failure and
I've changed nothing.

I think it was probably a bit of power supply noise or something that
corrupted a memory read or write, or something of that sort anyway. 


-- 
Chris Green
·


More information about the Python-list mailing list