[issue39845] Argparse on Python 3.7.1 (Windows) appends double quotes to string if it ends with backward slash

Eryk Sun report at bugs.python.org
Sun Mar 15 12:39:14 EDT 2020


Eryk Sun <eryksun at gmail.com> added the comment:

PowerShell translates single quotes to double quotes when they're used to delimit a string in the command line, which complies with VC++ command-line parsing and CommandLineToArgvW [1]. But PowerShell 5 has a bug here. It translates 'C:\unu doi\' into "C:\unu doi\". A double quote preceded by a backslash is parsed as a literal double quote. It should escape the trailing backslash as two backslashes, i.e. "C:\unu doi\\". PowerShell 6 (pwsh) implements it correctly.

[1]: https://docs.microsoft.com/en-us/cpp/c-language/parsing-c-command-line-arguments?view=vs-2019

----------
nosy: +eryksun
resolution:  -> third party
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39845>
_______________________________________


More information about the Python-bugs-list mailing list