[Python-Dev] Decoder functions accept str in py3k (original) (raw)

Guido van Rossum guido at python.org
Wed Jan 7 16:34:57 CET 2009


Sounds like yet another remnant of the old philosophy, which indeed supported encode and decode operations on both string types. :-(

On Wed, Jan 7, 2009 at 5:39 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:

Hello,

I've just noticed that in py3k, the decoding functions in the codecs module accept str objects as well as bytes: # import codecs # c = codecs.getdecoder('utf8') # c('aa') ('aa', 2) # c('éé') ('éé', 4) # c = codecs.getdecoder('latin1') # c('aa') ('aa', 2) # c('éé') ('Ã(c)Ã(c)', 4) Is it a bug? Regards Antoine.


Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org

--

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-Dev mailing list