Bug 53462 - Using Control-C to cancel webkit-patch or other python tools causes unpleasant traceback console spew
Summary: Using Control-C to cancel webkit-patch or other python tools causes unpleasan...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-31 15:57 PST by Darin Adler
Modified: 2011-02-01 12:36 PST (History)
5 users (show)

See Also:


Attachments
Patch (973 bytes, patch)
2011-02-01 11:22 PST, Adam Barth
no flags Details | Formatted Diff | Diff
Patch (1.11 KB, patch)
2011-02-01 11:39 PST, Adam Barth
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2011-01-31 15:57:42 PST
For example, I hit Control-C when webkit-patch was asking me about a diff

Was that diff correct? [Y/n]: Traceback (most recent call last):
  File "/Users/darin/Safari/OpenSource/Tools/Scripts/webkit-patch", line 70, in <module>
    main()
  File "/Users/darin/Safari/OpenSource/Tools/Scripts/webkit-patch", line 65, in main
    WebKitPatch(__file__).main()
  File "/Volumes/Home/darin/Safari/OpenSource/Tools/Scripts/webkitpy/tool/multicommandtool.py", line 308, in main
    result = command.check_arguments_and_execute(options, args, self)
  File "/Volumes/Home/darin/Safari/OpenSource/Tools/Scripts/webkitpy/tool/multicommandtool.py", line 117, in check_arguments_and_execute
    return self.execute(options, args, tool) or 0
  File "/Volumes/Home/darin/Safari/OpenSource/Tools/Scripts/webkitpy/tool/commands/abstractsequencedcommand.py", line 51, in execute
    self._sequence.run_and_handle_errors(tool, options, state)
  File "/Volumes/Home/darin/Safari/OpenSource/Tools/Scripts/webkitpy/tool/commands/stepsequence.py", line 70, in run_and_handle_errors
    self._run(tool, options, state)
  File "/Volumes/Home/darin/Safari/OpenSource/Tools/Scripts/webkitpy/tool/commands/stepsequence.py", line 64, in _run
    step(tool, options).run(state)
  File "/Volumes/Home/darin/Safari/OpenSource/Tools/Scripts/webkitpy/tool/steps/confirmdiff.py", line 73, in run
    diff_correct = self._tool.user.confirm("Was that diff correct?")
  File "/Volumes/Home/darin/Safari/OpenSource/Tools/Scripts/webkitpy/common/system/user.py", line 128, in confirm
    response = raw_input("%s [%s]: " % (message, choice))
KeyboardInterrupt

Yuck!

Who else should I cc on this bug?
Comment 1 Eric Seidel (no email) 2011-01-31 15:59:25 PST
We could catch these, sure.  For now we've enjoyed the default handler's print-the-stacktrace behavior.
Comment 2 Darin Adler 2011-01-31 16:09:54 PST
Since Iā€™m using the scripts, not developing them, the traceback is never useful to me.
Comment 3 Eric Seidel (no email) 2011-01-31 16:11:36 PST
Yes, I think you are correct that these scripts have moved from a development stage to being deployed and used and we should get rid of debug messages like these.  I agree with this bug completely.
Comment 4 Adam Barth 2011-02-01 11:22:26 PST
Created attachment 80793 [details]
Patch
Comment 5 Mihai Parparita 2011-02-01 11:35:22 PST
Comment on attachment 80793 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=80793&action=review

> Tools/Scripts/webkit-patch:72
> +        pass

Exiting with a non-0 exit code seems better (see http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py#L440)
Comment 6 Adam Barth 2011-02-01 11:39:15 PST
Created attachment 80797 [details]
Patch
Comment 7 Eric Seidel (no email) 2011-02-01 12:23:28 PST
Comment on attachment 80797 [details]
Patch

I would hav elogged "user interupted".  I might even put this in the multicommandtool.py instead.

Also, isn't there a python helper for the 128 + bit?

I don't think this should exit 0 though, so you're right in returning the signal code.
Comment 8 WebKit Commit Bot 2011-02-01 12:35:58 PST
Comment on attachment 80797 [details]
Patch

Clearing flags on attachment: 80797

Committed r77275: <http://trac.webkit.org/changeset/77275>
Comment 9 WebKit Commit Bot 2011-02-01 12:36:04 PST
All reviewed patches have been landed.  Closing bug.