This repository was archived by the owner on Jan 22, 2026. It is now read-only.
Commit 7a18271
committed
Don't support comments in parsed parameters
Until now, when virtinst was parsing parameters, '#' were used as
starts of a comment, '\' as escape strings etc. due to the use of
shlex. The use of '\' is predictable (e.g. filename with a ',' in
it), but the '#' is usually escaped in shell only. Also, even when
not escaped, shlex is not fully compatible with some syntax rules for
parsing '#'.
For example '#' in 'echo asdf#fdsa' will not be used as a comment in
bash (there is no whitespace in front of the '#'), but in our '--disk
name#something.img' (parsed using shlex), it will be used as a comment
even though it is not expected from the user.
Removing '#' (the only character) from shlex.commenters disables all
similar comments, which is desired as users won't be trying to use
comments to comment out parts of parameters.1 parent 7a18b87 commit 7a18271
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
1186 | 1186 | | |
1187 | 1187 | | |
1188 | 1188 | | |
| 1189 | + | |
1189 | 1190 | | |
1190 | 1191 | | |
1191 | 1192 | | |
| |||
0 commit comments