Issue 33974: _stringify handles quoted strings incorrectly
Created on 2018-06-26 18:52 by gauchj, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| 0001-improve-escaping-of-quoted-strings.patch | gauchj, 2018-06-26 18:52 | |||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 7986 | merged | serhiy.storchaka, 2018-06-28 12:00 | |
| PR 8018 | merged | miss-islington, 2018-06-30 06:20 | |
| PR 8019 | merged | miss-islington, 2018-06-30 06:21 | |
| PR 8021 | merged | serhiy.storchaka, 2018-06-30 09:45 | |
| Messages (8) | |||
|---|---|---|---|
| msg320508 - (view) | Author: Gauchj (gauchj) | Date: 2018-06-26 18:52 | |
_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.
|
|||
| msg320513 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2018-06-26 21:30 | |
How did you find this bug? |
|||
| msg320598 - (view) | Author: Gauchj (gauchj) | Date: 2018-06-27 16:16 | |
I tried to display entries from the Windows Registry in a TreeView. |
|||
| msg320663 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2018-06-28 12:03 | |
This issue needs more complex fix. PR 7986 adds necessary changes and tests. Thank you for your report Gauchj. |
|||
| msg320753 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2018-06-30 06:20 | |
New changeset 5bb5bbfca847524bab5f2368bdb48eedf5dba74f by Serhiy Storchaka in branch 'master': bpo-33974: Fix passing special characters to ttk widgets. (GH-7986) https://github.com/python/cpython/commit/5bb5bbfca847524bab5f2368bdb48eedf5dba74f |
|||
| msg320756 - (view) | Author: miss-islington (miss-islington) | Date: 2018-06-30 06:43 | |
New changeset 42ea5226642c2a416b32278914fa4738093298ff by Miss Islington (bot) in branch '3.7': bpo-33974: Fix passing special characters to ttk widgets. (GH-7986) https://github.com/python/cpython/commit/42ea5226642c2a416b32278914fa4738093298ff |
|||
| msg320757 - (view) | Author: miss-islington (miss-islington) | Date: 2018-06-30 06:43 | |
New changeset b2e88fcf63515f8a66759a6fdc75d08a0a440901 by Miss Islington (bot) in branch '3.6': bpo-33974: Fix passing special characters to ttk widgets. (GH-7986) https://github.com/python/cpython/commit/b2e88fcf63515f8a66759a6fdc75d08a0a440901 |
|||
| msg320769 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2018-06-30 10:34 | |
New changeset 9b84cc8771f52e9340ea5b676da9a15359c723b6 by Serhiy Storchaka in branch '2.7': [2.7] bpo-33974: Fix passing special characters to ttk widgets. (GH-7986) (GH-8021) https://github.com/python/cpython/commit/9b84cc8771f52e9340ea5b676da9a15359c723b6 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:02 | admin | set | github: 78155 |
| 2018-06-30 10:44:39 | serhiy.storchaka | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2018-06-30 10:34:58 | serhiy.storchaka | set | messages: + msg320769 |
| 2018-06-30 09:45:19 | serhiy.storchaka | set | pull_requests: + pull_request7629 |
| 2018-06-30 06:43:25 | miss-islington | set | messages: + msg320757 |
| 2018-06-30 06:43:00 | miss-islington | set | nosy:
+ miss-islington messages: + msg320756 |
| 2018-06-30 06:21:38 | miss-islington | set | pull_requests: + pull_request7627 |
| 2018-06-30 06:20:46 | miss-islington | set | pull_requests: + pull_request7626 |
| 2018-06-30 06:20:30 | serhiy.storchaka | set | messages: + msg320753 |
| 2018-06-28 12:03:46 | serhiy.storchaka | set | messages:
+ msg320663 versions: + Python 2.7 |
| 2018-06-28 12:00:49 | serhiy.storchaka | set | stage: patch review pull_requests: + pull_request7597 |
| 2018-06-27 16:16:52 | gauchj | set | messages: + msg320598 |
| 2018-06-26 21:30:00 | serhiy.storchaka | set | assignee: serhiy.storchaka messages:
+ msg320513 |
| 2018-06-26 18:52:55 | gauchj | create | |
