[Python-Dev] Decoder functions accept str in py3k

Antoine Pitrou solipsis at pitrou.net
Wed Jan 7 14:39:12 CET 2009


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('éé')
 ('éé', 4)

Is it a bug?

Regards

Antoine.




More information about the Python-Dev mailing list