[Python-Dev] Improve open() to support reading file starting with an unicode BOM

Lennart Regebro regebro at gmail.com
Mon Jan 11 13:45:30 CET 2010


On Mon, Jan 11, 2010 at 13:29, Walter Dörwald <walter at livinglogic.de> wrote:
> However if this autodetection feature is useful in other cases (no
> matter how it's activated), it should be a codec, because as part of the
> open() function it isn't reusable.

But an autodetect feature is not a codec. Sure it should be reusable,
but making it a codec seems to be  a weird hack to me. And how would
you reuse it if it was a codec? A reusable autodetect feature would be
useable to detect what codec it is. A autodetect codec would not be
useful for that, as it would simply just decode.

-- 
Lennart Regebro: Python, Zope, Plone, Grok
http://regebro.wordpress.com/
+33 661 58 14 64



More information about the Python-Dev mailing list