Re: [PATCH V2] util: improve iterfile so it chooses code path wisely

2016-11-16 Thread Jun Wu
Excerpts from Yuya Nishihara's message of 2016-11-17 00:25:39 +0900: > Perhaps os.read() is a thin wrapper over read(2), which says "EINTR The call > was interrupted by a signal before any data was read." In other words, read() > never raises EINTR if it has some data to return. Nice property! It'

Re: [PATCH V2] util: improve iterfile so it chooses code path wisely

2016-11-16 Thread Yuya Nishihara
On Wed, 16 Nov 2016 14:17:10 +, Jun Wu wrote: > Excerpts from Yuya Nishihara's message of 2016-11-16 21:51:50 +0900: > > On Tue, 15 Nov 2016 20:38:24 +, Jun Wu wrote: > > > +try: > > > +buf = os.read(fd, bufsize) > > > +except OSError as e

Re: [PATCH V2] util: improve iterfile so it chooses code path wisely

2016-11-16 Thread Jun Wu
Excerpts from Yuya Nishihara's message of 2016-11-16 21:51:50 +0900: > On Tue, 15 Nov 2016 20:38:24 +, Jun Wu wrote: > > # HG changeset patch > > # User Jun Wu > > # Date 1479241551 0 > > # Tue Nov 15 20:25:51 2016 + > > # Node ID f3d2f4ebc4006043684db52e4487756dd4e2d238 > > # Parent

Re: [PATCH V2] util: improve iterfile so it chooses code path wisely

2016-11-16 Thread Yuya Nishihara
On Tue, 15 Nov 2016 20:38:24 +, Jun Wu wrote: > # HG changeset patch > # User Jun Wu > # Date 1479241551 0 > # Tue Nov 15 20:25:51 2016 + > # Node ID f3d2f4ebc4006043684db52e4487756dd4e2d238 > # Parent d1a0a64f6e16432333bea0476098c46a61222b9b > # Available At https://bitbucket.org/qu

[PATCH V2] util: improve iterfile so it chooses code path wisely

2016-11-15 Thread Jun Wu
# HG changeset patch # User Jun Wu # Date 1479241551 0 # Tue Nov 15 20:25:51 2016 + # Node ID f3d2f4ebc4006043684db52e4487756dd4e2d238 # Parent d1a0a64f6e16432333bea0476098c46a61222b9b # Available At https://bitbucket.org/quark-zju/hg-draft # hg pull https://bitbucket.org/qu