WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
216604
[GTK][WPE] Missing support for multi-word $WEBKIT_MINI_BROWSER_PREFIX
https://bugs.webkit.org/show_bug.cgi?id=216604
Summary
[GTK][WPE] Missing support for multi-word $WEBKIT_MINI_BROWSER_PREFIX
Philippe Normand
Reported
2020-09-16 01:23:15 PDT
Currently if this var contains more than one word (like "gdb -args" or "perf record") a python traceback is spewed.
Attachments
Patch
(2.48 KB, patch)
2020-09-16 01:25 PDT
,
Philippe Normand
no flags
Details
Formatted Diff
Diff
Patch
(2.89 KB, patch)
2020-09-19 07:00 PDT
,
Philippe Normand
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Philippe Normand
Comment 1
2020-09-16 01:25:24 PDT
Created
attachment 408904
[details]
Patch
Adrian Perez
Comment 2
2020-09-17 04:37:20 PDT
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 :)
Philippe Normand
Comment 3
2020-09-17 08:59:34 PDT
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'] ¿
Adrian Perez
Comment 4
2020-09-18 05:23:03 PDT
(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']
>>>
;-)
Philippe Normand
Comment 5
2020-09-19 07:00:13 PDT
Created
attachment 409200
[details]
Patch
EWS
Comment 6
2020-09-21 11:59:02 PDT
Committed
r267350
: <
https://trac.webkit.org/changeset/267350
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 409200
[details]
.
Radar WebKit Bug Importer
Comment 7
2020-09-21 12:26:23 PDT
<
rdar://problem/69319805
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug