[issue33780] [subprocess] Better Unicode support for shell=True on Windows

2021-03-15 Thread Eryk Sun
Eryk Sun added the comment: The complexity of mixing standard I/O from the shell and external programs is a limitation of the Windows command line. Each program could choose to use the system (or process) ANSI or OEM code page, the console session's input or output code page, UTF-8, or UTF-1

[issue33780] [subprocess] Better Unicode support for shell=True on Windows

2018-06-17 Thread Yoni Rozenshein
Yoni Rozenshein added the comment: After reading your messages and especially after reading https://bugs.python.org/issue27179#msg267091 I admit I have been convinced this is much more complicated than I thought, and maybe more of a Windows bug than a Python bug :) -- _

[issue33780] [subprocess] Better Unicode support for shell=True on Windows

2018-06-06 Thread Eryk Sun
Eryk Sun added the comment: > By default, the output of cmd is encoded with the "active" > codepage. In Python 3.6, you can decode this using > encoding='oem'. FYI, the actual encoding is not necessarily "oem". The console codepage may have been changed from the initial value by a SetConso

[issue33780] [subprocess] Better Unicode support for shell=True on Windows

2018-06-06 Thread Eryk Sun
Eryk Sun added the comment: > To get the correct output, cmd has a "/u" switch (this switch has > probably existed forever - at least since Windows NT 4.0, by my > internet search). The output can then be decoded using > encoding='utf-16-le', like any native Windows string. However, the /u

[issue33780] [subprocess] Better Unicode support for shell=True on Windows

2018-06-06 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- components: +Windows nosy: +giampaolo.rodola, paul.moore, steve.dower, tim.golden, vstinner, zach.ware ___ Python tracker ___ _

[issue33780] [subprocess] Better Unicode support for shell=True on Windows

2018-06-06 Thread Yoni Rozenshein
New submission from Yoni Rozenshein : In subprocess, the implementation of shell=True on Windows is to launch a subprocess with using {comspec} /c "{args}" (normally comspec=cmd.exe). By default, the output of cmd is encoded with the "active" codepage. In Python 3.6, you can decode this using