Message324911
The interpreter uses the system ANSI codepage for non-console files. In your case this is codepage 1252. In my current setup I can't reproduce this issue since I'm using the new (beta) support in Windows 10 to configure the ANSI codepage as UTF-8 (65001).
You can force standard I/O to use UTF-8 by setting the environment variable PYTHONIOENCODING. Also, if you want the CompletedProcess stdout decoded as text, in 3.6+ you can pass the parameter `encoding='utf-8'`. For example:
environ = os.environ.copy()
environ['PYTHONIOENCODING'] = 'utf-8'
p = subprocess.run([sys.executable, *args], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=environ, encoding='utf-8')
print(p.stdout) |
|
Date |
User |
Action |
Args |
2018-09-10 03:55:57 | eryksun | set | recipients:
+ eryksun, paul.moore, vstinner, tim.golden, jkloth, ezio.melotti, zach.ware, steve.dower |
2018-09-10 03:55:57 | eryksun | set | messageid: <1536551757.15.0.56676864532.issue34618@psf.upfronthosting.co.za> |
2018-09-10 03:55:57 | eryksun | link | issue34618 messages |
2018-09-10 03:55:56 | eryksun | create | |
|