[merge] catching EPIPE (especially on win32)
John Arbash Meinel
john at arbash-meinel.com
Thu Jun 29 04:25:02 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The attached bundle slightly changes how bzr handles EPIPE.
It does 2 things. First, on win32 we don't get EPIPE, we actually get an
IOError exception with errno = 0. So for 'display_command' like 'bzr
log', we absorb that error.
The second thing is in run_bzr_catch_errors. The old code used a
'try/finally' to ensure that sys.stdout.flush() was always called.
However, if we were already in an exception, that could cause EPIPE,
which would mask the real exception.
And on win32, the second flush() was raising EINVAL.
With the attached patch, @display_command works properly on win32.
There is one more thing which needs discussing. @display_command also
swallows KeyboardInterrupt.
Which I wanted to open up for discussion.
It means that running 'bzr log' and then hitting ^C while it is
scrolling will just stop without any more info.
This isn't how CVS works. If you ^C in the middle, you get:
cvs [log aborted]: received interrupt signal
I think it is fine for bzr to print
bzr: interrupted
swalling KeyboardInterrupt also means that when the test suite is
running, you can't stop it with a simple ^C.
So I would rather just let KeyboardInterrupt continue uncaught. Anyone
agree/disagree?
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEo0gOJdeBCYSNAAMRAvYCAKDBxqWQZffQu6dy3hDJOYs0ixrCfwCgpD03
LPetBAAuG7T/kLoSIPE9nMU=
=7lph
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: win32-epipe.diff
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20060628/8ae9f20f/attachment.diff
More information about the bazaar
mailing list