sbt <shibt...@gmail.com> added the comment: > Which is fine. 'bytes' and byte literals were not introduced until > 2.6 [1,2]. So *any* solution we come > up with is for >= 2.6.
In 2.6 and 2.7, bytes is just an alias for str. In all 2.x versions with codecs.encode, the result will be str. (Although I haven't actually tested earlier than 2.6.) Python 2.6.5 (r265:79063, Jun 12 2010, 17:07:01) [GCC 4.3.4 20090804 (release) 1] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> import pickle >>> pickle.loads('\x80\x02c_codecs\nencode\nq\x00X\x03\x00\x00\x00abcq\x01X\x06\x00\x00\x00latin1q\x02\x86q\x03Rq\x04.') 'abc' >>> type(_) <type 'str'> ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13505> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com