Roundup Tracker - Issues

Message5230

Author jerrykan
Recipients ber, jerrykan, r.david.murray
Date 2015-02-27.12:58:18
Message-id <1425041899.62.0.936477834774.issue2550870@psf.upfronthosting.co.za>
In-reply-to
I've attached a patch that migrates from the rfc822 module to the email
module for files that import it:

 - roundup/cgi/client.py
 - roundup/mailgw.py
 - test/test_mailgw.py

The 'roundup/mailgw.py' stuff is pretty straight forward and the tests pass

The the section of code in 'roundup/cgi/client.py' that uses the rfc822
module are not covered by the tests, so it may be worth someone double
checking these changes.


The 'test/test_mailgw.py' is mostly converted but there are a few tests
that are failing so I have included skip() decorators for the time
being[1]. I've spent a bit of time looking into why the failures are
occurring and I think there are a few things contributing to the errors...

A lot of the message strings in the tests seem to have headers defined
twice (ie. 'FROM:' & 'From:', 'TO:' & 'To:'), and the behaviour for
parsing these seems to be different between the rfc822 and email
modules. I'm not sure if the duplicate headers were originally
intentional - to comply with how the rfc822 module works - or not.

The second thing is that the 'roundup/mailgw.py' seems to use the
mimetypes module to generate outgoing emails. This is another deprecated
module that should probably be replaced with the email module. It also
seems to generate messages with duplicate headers. Replacing the
mimetypes module would also seem to be a reasonable sized undertaking.

So that is about as far as I got with this. The next step would seem to
be to try and resolve the issues around the tests that are currently
being skipped, so if anyone can shed any light on the duplicate headers
things or have any other advice on how to proceed that would be helpful.

--

[1] note that the 'skip()' decorators are only available in python 2.7,
but that should be OK for the time being as they should be removed in
the final patch that fixes the reaming issues.
History
Date User Action Args
2015-02-27 12:58:19jerrykansetmessageid: <1425041899.62.0.936477834774.issue2550870@psf.upfronthosting.co.za>
2015-02-27 12:58:19jerrykansetrecipients: + jerrykan, ber, r.david.murray
2015-02-27 12:58:19jerrykanlinkissue2550870 messages
2015-02-27 12:58:19jerrykancreate