On 3/7/07, Jim Jewett <[EMAIL PROTECTED]> wrote: > On 3/6/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > I think maybe a useful simplification would be to support special > > return values to capture EWOULDBLOCK (or equivalent) in the raw I/O > > interface only. > > That makes sense. > > > The buffering layer could then raise IOError (or perhaps a special > > subclass of it) if the raw I/O layer ever returned one of these; > > Is this a "could", or "should"? I would expect the buffering layer > (particularly output) to use its buffer, and to appear blocking > (through sleep-and-retry) when that isn't enough. > > Or are you concerned that if it might really be blocked forever, and > should say so at the first opportunity?
If the read can be satisifed from the buffer, or with a single raw read call, I see no reason to return an error. But if a raw read call is necessary and the raw read call returns None, the buffered layer should *not* retry since that would just turn it into a busy-wait loop until the read can be satisfied, which is a really bad idea. -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com