[Python-ideas] Iterating non-newline-separated files should be easier
Wichert Akkerman
wichert at wiggy.net
Sun Jul 20 09:58:44 CEST 2014
> On 20 Jul 2014, at 03:40, Nick Coghlan <ncoghlan at gmail.com> wrote:
>
> On 20 July 2014 11:31, Chris Angelico <rosuav at gmail.com> wrote:
>> On Sun, Jul 20, 2014 at 11:23 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
>>> At present, I'm genuinely unclear on
>>> why someone would ever want to pass the "-0" option to the other UNIX
>>> utilities, which then makes it very difficult to have a sensible
>>> discussion on how we should address that use case in Python.
>>
>> That one's easy. What happens if you use 'find' to list files, and
>> those files might have \n in their names? You need another sep.
>
> Yes, but having a newline in a filename is sufficiently weird that I
> find it hard to imagine a scenario where "fix the filenames" isn't a
> better answer.
Because you are likely to have no control af all over what people do with filenames. Since, on POSIX at least, filenames are allowed to contain all characters other than NUL and / you must be able to deal with that. Similar to how you must also be able to deal with a mixture of filenames using different encodings or even pure binary names.
Wichert.
More information about the Python-ideas
mailing list