[Python-Dev] subprocess.Popen and win32

Antoine Pitrou solipsis at pitrou.net
Sun Apr 20 11:42:07 CEST 2014


On Sat, 19 Apr 2014 19:02:42 -0700
David Aguilar <davvid at gmail.com> wrote:
> 
> On python3, this still works for normal platforms, but on windows we
> can't pass a list of byte strings. We have to pass a list of unicode
> strings.

Windows native APIs are unicode-based. It is actually necessary to pass
*unicode* strings, not byte strings, if you want your code to be
correct in the face of non-ASCII characters.

Under other platforms, when unicode strings are passed, Python will
encode them using the platform's detected encoding. So, unless your
platform is somehow misconfigured, passing unicode strings will also
work correctly there.

(note this is under Python 3)

Regards

Antoine.




More information about the Python-Dev mailing list