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? -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
