Bug 238737

Summary: webkitpy.w3c.test_exporter assumes all exceptions are HTTPError
Product: WebKit Reporter: Sam Sneddon [:gsnedders] <gsnedders>
Component: Tools / TestsAssignee: Sam Sneddon [:gsnedders] <gsnedders>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, glenn, jbedard, koivisto, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=238735
Attachments:
Description Flags
Patch none

Sam Sneddon [:gsnedders]
Reported 2022-04-04 07:24:30 PDT
This is the second exception in bug 238735: During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/antti/webkit/OpenSource/Tools/Scripts//webkit-patch", line 80, in <module> main() File "/Users/antti/webkit/OpenSource/Tools/Scripts//webkit-patch", line 75, in main WebKitPatch(os.path.abspath(__file__)).main() File "/Users/antti/webkit/OpenSource/Tools/Scripts/webkitpy/tool/multicommandtool.py", line 305, in main result = command.check_arguments_and_execute(options, args, self) File "/Users/antti/webkit/OpenSource/Tools/Scripts/webkitpy/tool/multicommandtool.py", line 123, in check_arguments_and_execute return self.execute(options, args, tool) or 0 File "/Users/antti/webkit/OpenSource/Tools/Scripts/webkitpy/tool/commands/abstractsequencedcommand.py", line 55, in execute self._sequence.run_and_handle_errors(tool, options, state) File "/Users/antti/webkit/OpenSource/Tools/Scripts/webkitpy/tool/commands/stepsequence.py", line 73, in run_and_handle_errors self._run(tool, options, state) File "/Users/antti/webkit/OpenSource/Tools/Scripts/webkitpy/tool/commands/stepsequence.py", line 67, in _run step(tool, options).run(state) File "/Users/antti/webkit/OpenSource/Tools/Scripts/webkitpy/tool/steps/wptchangeexport.py", line 53, in run test_exporter.do_export() File "/Users/antti/webkit/OpenSource/Tools/Scripts/webkitpy/w3c/test_exporter.py", line 397, in do_export self.make_pull_request() File "/Users/antti/webkit/OpenSource/Tools/Scripts/webkitpy/w3c/test_exporter.py", line 336, in make_pull_request pr_number = self.create_wpt_pull_request(self._wpt_fork_remote + ':' + self._public_branch_name, self._commit_message, description) File "/Users/antti/webkit/OpenSource/Tools/Scripts/webkitpy/w3c/test_exporter.py", line 352, in create_wpt_pull_request if e.code == 422: AttributeError: 'TypeError' object has no attribute 'code' Essentially, we seem to be assuming we always have a code attribute (which urllib.error.HTTPError has), but catching every exception.
Attachments
Patch (2.04 KB, patch)
2022-04-04 07:42 PDT, Sam Sneddon [:gsnedders]
no flags
Sam Sneddon [:gsnedders]
Comment 1 2022-04-04 07:42:22 PDT
Created attachment 456569 [details] Patch This I think would fix it, but there's no easy way to test this currently, short of exporting something.
Radar WebKit Bug Importer
Comment 2 2022-04-11 07:25:15 PDT
Sam Sneddon [:gsnedders]
Comment 3 2022-04-11 14:44:01 PDT
Comment on attachment 456569 [details] Patch Let's just land this because from a basic review it's obvious that it shouldn't make anything worse.
EWS
Comment 4 2022-04-11 15:57:59 PDT
Committed r292731 (249516@main): <https://commits.webkit.org/249516@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 456569 [details].
Note You need to log in before you can comment on or make changes to this bug.