[Python-ideas] Iterating non-newline-separated files should be easier

Akira Li 4kir4.1i at gmail.com
Wed Jul 23 01:48:06 CEST 2014


Paul Moore <p.f.moore at gmail.com> writes:

> On 22 July 2014 17:05, Akira Li
> <4kir4.1i at gmail.com> wrote:
>> The example function handles Unicode whitespace to demonstrate why
>> opaque bytes-based cookies can't be used to represent filenames in this
>> case even on POSIX, though which characters are recognized depends on
>> sys.getfilesystemencoding().
>
> Thanks. That's how you'd do it now.

You've cut too much e.g. I wrote in [1]:

>> io.TextIOWrapper() plays the role of open() in this case. The code
>> assumes that `newline` parameter accepts '\0'.

[1] https://mail.python.org/pipermail/python-ideas/2014-July/028372.html

> A question for the OP: how would the proposed change improve this code?
> Paul

I'm not sure who is OP in this context but I can answer: the proposed
change might allow TextIOWrapper(.., newline='\0') and the code in [1]
doesn't support `-0` command-line parameter without it.


--
Akira



More information about the Python-ideas mailing list