[Moin-user] email issue...?? Python 2.41 and encoding?

Schollnick, Benjamin Benjamin.Schollnick at xerox.com
Wed Aug 9 13:48:14 EDT 2006


Folks,

I am having an issue with email's having extra characters in them...
For example:

-----
Login Password: {SHA}HwFgB2yfQqFX8Kjw3MaOAv9pBFs=3D

Login URL:
http://cmsw931.na.xerox.net/torchwood/moin.cgi/UserPreferences?a=
ction=3Dlogin
------

And I think I have tracked it down in the MoinMoin.util.mail module...

I believe line 79:
    msg.set_payload (charset.body_encode(text))

is responsible....  If I change it to:
    msg.set_payload (charset.convert (text) )
#(charset.body_encode(text))

Everything works fine.... and we get:

	Login Name: FirstnameLastName

	Login Password: {SHA}HwFgB2yfQqFX8Kjw3MaOAv9pBFs=

	Login URL:
http://cmsw931.na.xerox.net/torchwood/moin.cgi/UserPreferences?action=lo
gin

This is under Python 2.41....


--- Line 71 - 79 --- of MoinMoin.util.mail

    # Create a message using config.charset and quoted printable
    # encoding, which should be supported better by mail clients.
    # TODO: check if its really works better for major mail clients
    msg = Message()
    charset = Charset(config.charset)
    charset.header_encoding = QP
    charset.body_encoding = QP
    msg.set_charset(charset)    
    msg.set_payload (charset.convert (text) )
#(charset.body_encode(text))




More information about the Moin-user mailing list