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

Ion Cebotari report at bugs.python.org
Thu Mar 5 04:50:14 EST 2020


Ion Cebotari <anathemizatu at mail.ru> 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', capturetimefmt_full='%y.%m.%d_%H-%M-%S', ca
pturetimefmt_short='%y.%m.%d_%H', dest_dir='C:\\unu doi"', dry_run=True, output_
file='stdout', processes=2, src_dir='Z:\\tmp\\test\\DJI\\', tl_interval_threshol
d=30, tl_numimages_threshold=75, verbose=False, version=None)

Linux output:
python main.py --verbose ~/tmp/test/DJI/ /tmp/123
sys.argv:
['CamCardOrganizer.py', '--verbose', '/home/ion/tmp/test/DJI/', '/tmp/123']
args namespace:
Namespace(capturedatefmt='%y.%m.%d', capturetimefmt_full='%y.%m.%d_%H-%M-%S', capturetimefmt_short='%y.%m.%d_%H', dest_dir='/tmp/123', dry_run=False, output_file='stdout', processes=2, src_dir='/home/ion/tmp/test/DJI/', tl_interval_threshold=30, tl_numimages_threshold=75, verbose=True, version=None)

----------

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


More information about the Python-bugs-list mailing list