Bug 315130
| Summary: | Fix run-minibrowser/run-swiftbrowser crash on argparse 'const' kwarg | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | zak ridouh <zakr> |
| Component: | Tools / Tests | Assignee: | zak ridouh <zakr> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
zak ridouh
run-minibrowser and run-swiftbrowser translate each optparse Option from
configuration_options() / platform_options() into an argparse add_argument()
call, and were unconditionally forwarding const=option.const. That worked
while every option used action='store' or 'store_const' (both accept const),
but 313522@main added --cmake with action='store_true'. argparse's
_StoreTrueAction.__init__ does not accept a const keyword, so the loop now
raises:
TypeError: __init__() got an unexpected keyword argument 'const'
before the parser is even built, breaking both scripts at startup.
Only forward const= for the actions that accept it (store_const,
append_const). All other options keep their previous behavior.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/177472652>
zak ridouh
Pull request: https://github.com/WebKit/WebKit/pull/65228
EWS
Committed 313527@main (85a8efec82da): <https://commits.webkit.org/313527@main>
Reviewed commits have been landed. Closing PR #65228 and removing active labels.