Force utf-8 instead of ascii in psn-account-id.py #103

This commit is contained in:
Florian Märkl 2019-11-20 16:23:23 +01:00
commit e368a82e8f
No known key found for this signature in database
GPG key ID: 125BC8A5A6A1E857

View file

@ -6,6 +6,11 @@ if sys.version_info < (3, 0, 0):
print("DO NOT use Python 2.\nEVER.\nhttps://pythonclock.org")
exit(1)
if sys.stdout.encoding.lower() == "ascii":
import codecs
sys.stdout = codecs.getwriter('utf-8')(sys.stdout.buffer)
sys.stderr = codecs.getwriter('utf-8')(sys.stderr.buffer)
try:
import requests
except ImportError as e: