osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Python 3.2 has some deadly infection


On Wed, Jun 4, 2014 at 12:18 AM, Robin Becker <robin at reportlab.com> wrote:
> I think the idea that we only give meaning to binary data using encodings is
> a bit limiting. A zip or gif file has structure, but I don't think it's
> reasonable to regard such a file as having an encoding in the python unicode
> sense.

Of course it doesn't. Those are binary files. Ultimately, every file
is binary; but since the vast majority of them actually contain text,
in one of a handful of common encodings, it's nice to have an easy way
to open a text file. You could argue that "rb" should be the default,
rather than "rt", but that's a relatively minor point.

ChrisA