[PATCH] ui: ignore EIO in write_err

Martin Geisler mg at lazybytes.net
Sun Jun 20 09:11:59 CDT 2010


Mads Kiilerich <mads at kiilerich.com> writes:

> On 06/16/2010 09:20 AM, Dirkjan Ochtman wrote:
>> On Wed, Jun 16, 2010 at 00:24, Mads Kiilerich<mads at kiilerich.com>  wrote:
>>> diff --git a/mercurial/ui.py b/mercurial/ui.py
>>> --- a/mercurial/ui.py
>>> +++ b/mercurial/ui.py
>>> @@ -369,7 +369,7 @@
>>>              if not getattr(sys.stderr, 'closed', False):
>>>                  sys.stderr.flush()
>>>          except IOError, inst:
>>> -            if inst.errno != errno.EPIPE:
>>> +            if inst.errno not in [errno.EPIPE, errno.EIO]:
>>>                  raise
>>>
>>>      def flush(self):
>>
>> Nit: this feels like it should be a tuple, not a list.
>
> I feel like lists are more like "columns" where all the items have the
> same type, while tuples are more like "rows" where the items have
> different types and different semantics depending on their position.
> In this case it _is_ a list, not a tuple. We could use tuples to
> implement immutable lists, but I prefer the clarity of using lists for
> lists.

In principle, I see lists as mutable, ordered collections of homogeneous
values where the exact position does not matter. But it's also common to
use tuples for small fixes-size lists, tough a list is nicer.

> A better question could however be if there is any reason why we
> shouldn't ignore all IOErrors in write_err - that would avoid this
> discussion ,-)

Do you think that is better, or should I push your current patch?

-- 
Martin Geisler

Mercurial links: http://mercurial.ch/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100620/e526a121/attachment.pgp>


More information about the Mercurial-devel mailing list