This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gauchj
Recipients gauchj
Date 2018-06-26.18:52:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
_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.
Date User Action Args
2018-06-26 18:52:55gauchjsetrecipients: + gauchj
2018-06-26 18:52:55gauchjsetmessageid: <>
2018-06-26 18:52:55gauchjlinkissue33974 messages
2018-06-26 18:52:55gauchjcreate