◐ Shell
clean mode source ↗

Message 206938 - Python tracker

An alternative solution, which worked for me, is:
add file named sitecustomize.py in Lib\site-packages folder.

The contents of the file:
import sys
sys.setdefaultencoding("cp1251")

The default encoding should be determined for every localized Windows version.
Also, when creating virtual environments, the same file should be placed in site-packages folder of virtual environment being created prior to installing setuptools in it.