Commit c90c49e1 authored by aroben@apple.com's avatar aroben@apple.com

Don't try to seek to the end of stdin on Cygwin

Doing so seems to always cause an exception (for unknown reasons).

Fixes <http://webkit.org/b/28159> create-bug throws an exception in
Cygwin

Reviewed by Dave Kilzer.

* Scripts/bugzilla-tool:
(CreateBug.prompt_for_bug_title_and_comments): Ignore IOErrors
generated by calling sys.stdin.seek, since these seem to be generated
for no good reason on Cygwin.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@47121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2055b062
2009-08-12 Adam Roben <aroben@apple.com>
Don't try to seek to the end of stdin on Cygwin
Doing so seems to always cause an exception (for unknown reasons).
Fixes <http://webkit.org/b/28159> create-bug throws an exception in
Cygwin
Reviewed by Dave Kilzer.
* Scripts/bugzilla-tool:
(CreateBug.prompt_for_bug_title_and_comments): Ignore IOErrors
generated by calling sys.stdin.seek, since these seem to be generated
for no good reason on Cygwin.
2009-08-12 Adam Roben <aroben@apple.com>
Don't raise an exception when --cc is not passed to create-bug
......
......@@ -554,7 +554,16 @@ class CreateBug(Command):
bug_title = raw_input("Bug title: ")
print "Bug comment (hit ^D on blank line to end):"
lines = sys.stdin.readlines()
sys.stdin.seek(0, os.SEEK_END)
try:
sys.stdin.seek(0, os.SEEK_END)
except IOError:
# Cygwin raises an Illegal Seek (errno 29) exception when the above
# seek() call is made. Ignoring it seems to cause no harm.
# FIXME: Figure out a way to get avoid the exception in the first
# place.
pass
else:
raise
comment_text = ''.join(lines)
return (bug_title, comment_text)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment