[rfc] why bzr raise error when pipe closed too early?

Martin Pool mbp at canonical.com
Sun Jun 11 23:35:21 BST 2006


On 11 Jun 2006, Alexander Belchenko <bialix at ukr.net> wrote:
> When I run command 'bzr log' on branch that has big history and redirect
> output via pipe to 'less' or 'more' pager, and if I break viewing output
> before I see all history, then on win32 I very often got error:
> 
> bzr: ERROR: exceptions.IOError: [Errno 22] Invalid argument
>   at E:\work\Python\bzr\devel\bzr.dev\bzrlib\commands.py line 701
>   in run_bzr_catch_errors
> 
> I see that in function run_bzr_catch_errors() explicitly checked for
> IOError with errno==32 (errno.EPIPE). But as you can see on windows I've
> got IOError with errno==22 (errno.EINVAL). I don't know is it intended
> behaviour or not, but probably bzr don't need to show this error because
> this error is harmless and pointless. Only strange and non-informative
> for users.
> 
> May be bzr should suppress this error report?

Well, we try to supress it on Unix so I suppose we should do that on
Windows too.  It is a bit gross that EINVAL (which could indicate other
more serious problems) is reported for this.  I'm somewhat loath to
ignore it entirely - maybe we can just catch around the writes to
stdout?

-- 
Martin




More information about the bazaar mailing list