How to solve UnicodeDecodeError in Python 3.6?

前端 未结 5 1905
花落未央
花落未央 2021-01-02 15:58

I am switched from Python 2.7 to Python 3.6.

I have scripts that deal with some non-English content.

I usually run scripts via Cron and also in Terminal.

5条回答
  •  执笔经年
    2021-01-02 16:33

    I had this issue when using Python inside a Docker container based on Ubuntu 18.04. It appeared to be a locale issue, which was solved by adding the following to the Dockerfile:

    ENV LANG C.UTF-8
    

提交回复
热议问题