On 8/15/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 8/15/07, Adam Olsen <[EMAIL PROTECTED]> wrote: > > On 8/14/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > (2) newline='': input with untranslated universal newlines mode; lines > > > may end in \r, \n, or \r\n, and these are returned untranslated. > > > > Caveat: this mode cannot be supported by sockets. When reading a lone > > \r you need to peek ahead to ensure the next character is not a \n, > > but for sockets that may block indefinitely. > > It depends on what you want. In general *any* read from a socket may > block indefinitely. If the protocol requires turning around at \r *or* > \r\n I'd say the protocol is insane. > > > I don't expect sockets to use the file API by default, but there's > > enough overlap (named pipes?) that limitations like this should be > > well documented (and if possible, produce an explicit error!) > > Why do you want it to produce an error? Who says I don't know what I'm > doing when I request that mode?
As you just said, you'd be insane to require it. But on second thought I don't think we can reliably say it's wrong. A named pipe may just have a file cat'd through it, which would handle this mode just fine. It should be documented that interactive streams cannot safely use this mode. -- Adam Olsen, aka Rhamphoryncus _______________________________________________ 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