Skip to content
Advertisement

Pylint setup with pre-commit In python 3.5

I was trying to set up pylint with pre-commit in my project.
I came to this answer where they tell how to set up my .pre-commit-config.yaml.
When I went to the repository mentioned in the answer, they had written that

This mirror repository is deprecated, use pylint directly.

So I set my .pre-commit-config.yaml file like this

JavaScript

But now when I tried to do

JavaScript

It gave the following error:

JavaScript

My project and virtual environment’s python version is 3.5.2.
Is this a bug in pylint or pre-commit? Or am I doing something wrong?

Advertisement

Answer

It looks like you’re running in an environment with broken/incorrect locales set.

Search for your current locale setting by running env | grep -E '(LC|LANG)' and perhaps python3 -m locale

If configured correctly, python should be picking the UTF-8 encoding — usually you can correct whatever .bashrc / etc. is setting to an invalid locale, or you can set it yourself

A common value is: LANG=C.UTF-8 or LANG=en_US.UTF-8


EDIT: I’m also fixing pylint here

Advertisement