Since Python 3.7 you can change the encoding of standard streams with reconfigure():
sys.stdout.reconfigure(encoding='utf-8')
You can also modify how encoding errors are handled by adding an errors parameter.
Since Python 3.7 you can change the encoding of standard streams with reconfigure():
sys.stdout.reconfigure(encoding='utf-8')
You can also modify how encoding errors are handled by adding an errors parameter.