[Python-Dev] PEP 529: Change Windows filesystem encoding to UTF-8

Nick Coghlan ncoghlan at gmail.com
Wed Sep 7 23:38:30 EDT 2016


On 8 September 2016 at 03:37, Guido van Rossum <guido at python.org> wrote:
> On Sun, Sep 4, 2016 at 11:58 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
>> While calling system native apps that way will still have many
>> portability challenges, there are also plenty of cases where folks use
>> sys.executable to launch new Python processes in a separate instance
>> of the currently running interpreter, and it would be good if these
>> changes brought cross-platform consistency to the handling of binary
>> arguments here as well.
>
> I checked with Steve and this is not supported anyway -- bytes
> arguments (regardless of the value of shell) fail early with a
> TypeError. That may be a bug but there's no backwards compatibility to
> preserve here. (And apart from Python, few shell commands that work on
> Unix make much sense on Windows, so Im also not particularly worried
> about that particular example being non-portable -- it doesn't
> represent a realistic concern.)

Cool, I suspected "That already doesn't work, so you just have to use
strings for cross-platform compatibility in those cases" would be the
answer, and I think that's a sensible way to go. Even on *nix passing
bytes arguments to subprocess is unusual, since anyone with Python 2
based habits will omit the "b" prefix from literals, and anything
coming from the command line, environment, or other user input is
supplied as text by default.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list