New submission from Adam Mead: Under windows the following code does not pass the LFN to the script. Nor does any other method I've tried (getopts & argparse)
test.py import sys print ('Number of arguments:', len(sys.argv), 'arguments.') print ('Argument List:', str(sys.argv)) for x in range(0, len(sys.argv)): print("->" + sys.argv[x]) ---------------------------------------- Output with quotes: H:\bin>test "test lfn.txt" Number of arguments: 3 arguments. Argument List: ['H:\\bin\\test.py', ' test', 'lfn.txt'] ->H:\bin\test.py -> test ->lfn.txt Output when doubling the quotes: H:\bin>test ""test lfn.txt"" Number of arguments: 2 arguments. Argument List: ['H:\\bin\\test.py', ' "test lfn.txt"'] ->H:\bin\test.py -> "test lfn.txt" ---------- components: Windows messages: 233240 nosy: Adam.Mead, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Command line long filename not passed correctly type: behavior versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23141> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com