LastMinuteFlashcards icon indicating copy to clipboard operation
LastMinuteFlashcards copied to clipboard

windows python 3.6.3 ,encoding problem

Open climbingDog opened this issue 6 years ago • 1 comments

my python version is 3.6.3.,and my system is windows. when i print import sys; sys.getdefaultencoding; python show 'utf-8' but i still get the error'Encoding not satisfied, please run 'export PYTHONIOENCODING=UTF-8' before runnin g this python script'.

climbingDog avatar Oct 08 '18 04:10 climbingDog

Never run it on Windows before. But according to the official document, on 3.6 on Windows, PYTHONIOENCODING is ignored in a console unless PYTHONLEGACYWINDOWSSTDIO is also specified.

So you can try to set PYTHONLEGACYWINDOWSSTDIO too.

BTW, use sys.stdout.encoding instead of sys.getdefaultencoding to check.

jaspersjsun avatar Oct 09 '18 16:10 jaspersjsun