On 27/02/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 2/27/07, Paul Moore <[EMAIL PROTECTED]> wrote: > [...] > > Documenting the revised open() factory in this PEP would be useful. It > > needs to address encoding issues, so it's not a simple copy of the > > existing open(). > > Check the doc again. I added on at the end. It could use some review. > I also added an elaboration into the p3yk branch in svn; that could > use some review as well.
Sorry, I hadn't checked the updated version. I'll take a look. [...] > I think for input we should always accept all three line endings so > you never need to specify anything; for output, we should pick a > platform default (\r\n on Windows, \n everywhere else) and have an API > to override it. So the API you quote above sounds about right: > > .__init__(self, buffer, encoding=None, newline=None) > > I'd like to constrain newline to be either \n or \r\n for writing; for > reading IMO it should not be specified. Ah. If that's the intent, I agree - in effect universal newlines is always on, and output uses platform semantics unless you force it to be overridden. Forcing only \n or \r\n sounds fine to me. Paul. _______________________________________________ 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