Currently if this var contains more than one word (like "gdb -args" or "perf record") a python traceback is spewed.
Created attachment 408904 [details] Patch
Comment on attachment 408904 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=408904&action=review > Tools/Scripts/webkitpy/port/gtk.py:272 > + command = os.environ["WEBKIT_MINI_BROWSER_PREFIX"].split() + command Is there any reason to not use shlex.split() here? That would allow for specifying parameters in the environment variable which have themselves spaces, by carefully quoting things around. For example: WEBKIT_MINI_BROWSER_PREFIX="'/opt/dev tools v1/bin/gdb' --args" \ run-minibrowser […] Using a plain str.split() would completely prevent such usage. Not that I expect quoting of parameters inside the environment variable to be needed often, but it does not hurt to have our backs covered :)
In your example would the string with spaces inside need to be quoted again then to result in: ['"/opt/dev tools v1/bin/gdb"', '--args'] ¿
(In reply to Philippe Normand from comment #3) > In your example would the string with spaces inside need to be quoted again > then to result in: > > ['"/opt/dev tools v1/bin/gdb"', '--args'] > > ¿ Note that “shlex.split()” uses the same parsing rules as the Bourne shell, so it results in the correct thing: >>> import shlex >>> shlex.split('"/opt/dev tools v1/bin/gdb" --args') ['/opt/dev tools v1/bin/gdb', '--args'] >>> shlex.split('"/opt/dev tools v1/bin/gdb" --args') ['/opt/dev tools v1/bin/gdb', '--args'] >>> ;-)
Created attachment 409200 [details] Patch
Committed r267350: <https://trac.webkit.org/changeset/267350> All reviewed patches have been landed. Closing bug and clearing flags on attachment 409200 [details].
<rdar://problem/69319805>