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

2020-03-15 Thread Eryk Sun
Eryk Sun 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

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

2020-03-05 Thread paul j3
paul j3 added the comment: Then this isn't an argparse issue. Probably not even a Python one. The windows shell (which one? cmd.exe? power? some batch) is making the substitution. I see lots of discussion about Windows use of backslash, both as directory separator and escape. None

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

2020-03-05 Thread Ion Cebotari
Ion Cebotari added the comment: Yes, the problem seems to be with sys.argv.: Windows output: python .\main.py -d Z:\tmp\test\DJI\ 'C:\unu doi\' sys.argv: ['.\\CamCardOrganizer.py', '-d', 'Z:\\tmp\\test\\DJI\\', 'C:\\unu doi"'] args namespace: Namespace(capturedatefmt='%y.%m.%d',

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

2020-03-04 Thread paul j3
paul j3 added the comment: Could you show the sys.argv (for both the linux and windows cases)? print(args) (without your correction) might also help, just to see the 'raw' Namespace. (I'd have to restart my computer to explore the Windows behavior myself). --

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

2020-03-04 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +paul.j3, rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2020-03-04 Thread Ion Cebotari
New submission from Ion Cebotari : I have this code for a tool that copies files from one directory to another: parser = argparse.ArgumentParser() parser.add_argument('src_dir') parser.add_argument('dest_dir') args = parser.parse_args() It works fine on Unix, but on Windows, if the