Re: [Mailman-Developers] Python3 port of Mailman3

On Nov 26, 2014, at 02:30 PM, Abhilash Raj wrote:
Yay! Note that I also have been playing around with it a bit. I wouldn't say it's a functional branch, but you might compare notes:
lp:~barry/mailman/py3
Right. "resource_string" is really a misnomer. In another Python 3 project I work on, I use:
from pkg_resource import resource_string as resource_bytes
just so that the call sites are accurate.
You can of course also decode the bytestring that "resource_bytes" returns. That's generally what I do in that other project.
I think utf-8 is generally the right encoding to use, except in contexts where
you are given a better hint. E.g. if you're decoding say the payload of a
message with a Content-Type header, and that header has a charset
attribute,
it will name the encoding that you're supposed to use.
There may be cases where us-ascii or latin-1 would be better, but I think those should be determined on a case-by-case basis.
The trunk should now be python2.7 -3
clean, so it's ready to be ported.
I'd probably not try to run the full test suite yet, but start at the lowest
level, e.g. database/model and work your way up. If there are changes that
make sense even in Python 2 (i.e. for bilingual support for now) try to
put those in separate branches and merge proposals, so they can be merged into
trunk even before a full port.
This page will be indispensable:
https://wiki.python.org/moin/PortingToPy3k/BilingualQuickRef
Cheers, -Barry
participants (1)
-
Barry Warsaw