Hi, On Thursday 09 August 2007 02:41:08 Victor Stinner wrote: > I started to work on email module to port it for Python 3000, but I have > trouble to understand if a function should returns bytes or str (because I > don't know email module).
It's really hard to convert email module to Python 3000 because it does mix byte strings and (unicode) character strings... I wrote some notes about bytes/str helping people to migrate Python 2.x code to Python 3000, or at least to explain the difference between Python 2.x "str" type and Python 3000 "bytes" type: http://wiki.python.org/moin/BytesStr About email module, some deductions: test_email.py: openfile() must use 'rb' file mode for all tests base64MIME.decode() and base64MIME.encode() should accept bytes and str base64MIME.decode() result type is bytes base64MIME.encode() result type should be... bytes or str, no idea Other decode() and encode() functions should use same rules about types. Python modules (binascii and base64) choosed bytes type for encode result. Victor Stinner aka haypo http://hachoir.org/ _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com