_stringify escapes special characters so they can be processed by tcl/tk. To that end, two different escaping techniques are implemented: put a backslash in front of every special character or put the entire string in curly braces.
However, a string like the following one:
'"C:\\Windows\\System32\\notepad.exe" "afile.txt"'
will be incorrectly escaped to
'"C:\\\\Windows\\\\System32\\\\notepad.exe"\\ "afile.txt"'
Tcl/TK will interpret this as a quoted string, but with a backslash after it (the one escaping the space between the quoted strings), throwing this exception:
TclError('list element in quotes followed by "\\" instead of space',)
The attached patch escapes this to
'{"C:\\\\Windows\\\\System32\\\\notepad.exe" "afile.txt"}'
I am not 100% sure that this is correct since double backslashes seem to be displayed now. |