D
D
daniilpetrenkoo2021-05-20 23:47:06
FastCGI
daniilpetrenkoo, 2021-05-20 23:47:06

Why does an UncodeDecodeError occur when opening a file on WSGI?

When opening open('path/to/example.json', 'r').read() a Cyrillic file, an error occurs
60a6add495756567025520.png
Everything works fine on the console

Locale 60a6c9e633abb303356577.png

I don't understand in which direction to move to solve the problem

UPD: I would like it - solve something at the server level, without rewriting the code for opening a file with an encoding

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yupiter7575, 2021-05-20
@yupiter7575

io.open

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question