Roundup Tracker - Issues

Message3672

Author yyz
Recipients yyz
Date 2009-04-01.15:58:50
Message-id <1238601532.59.0.0224673891196.issue2550534@psf.upfronthosting.co.za>
In-reply-to
This is basically a copy of the report I sent to roundup-users.  With a little extra information 
before the traceback.

I'm running some tests with Roundup 1.4.8 and I was having a lot of
problems with the bounce_message function from mailer.py.
    
It looks like fallout from transitioning to the email package.  For one the documentation of 
the error parameter is incorrect.  error is passed in a list.  Looking through the svn history, it 
used to get '\n'.join()-ed so I did that, but that just exposed an error in the email creation.  
bounce_message attempted to attach files to a plain/text message.  So I changed it to use a 
MIMEMultipart.

I've attached the output of svn.diff

Specifically the error I was getting (at first) was:

Traceback (most recent call last):
  File "/u/testreq/bin/roundup-mailgw", line 3, in <module>
    run()
  File "/u/testreq/lib/python/roundup/scripts/roundup_mailgw.py", line
210, in run
    sys.exit(main(sys.argv))
  File "/u/testreq/lib/python/roundup/scripts/roundup_mailgw.py", line
153, in main
    return handler.do_pipe()
  File "/u/testreq/lib/python/roundup/mailgw.py", line 554, in do_pipe
    self.main(s)
  File "/u/testreq/lib/python/roundup/mailgw.py", line 716, in main
    return self.handle_Message(Message(fp))
  File "/u/testreq/lib/python/roundup/mailgw.py", line 773, in
handle_Message
    self.mailer.bounce_message(message, [sendto[0][1]], m)
  File "/u/testreq/lib/python/roundup/mailer.py", line 147, in
bounce_message
    part = MIMEText(error)
  File "/lusr/opt/python-2.5.4/lib/python2.5/email/mime/text.py", line
30, in __init__
    self.set_payload(_text, _charset)
  File "/lusr/opt/python-2.5.4/lib/python2.5/email/message.py", line
220, in set_payload
    self.set_charset(charset)
  File "/lusr/opt/python-2.5.4/lib/python2.5/email/message.py", line
260, in set_charset
    cte(self)
  File "/lusr/opt/python-2.5.4/lib/python2.5/email/encoders.py", line
73, in encode_7or8bit
    orig.encode('ascii')
AttributeError: 'list' object has no attribute 'encode'
History
Date User Action Args
2009-04-01 15:58:52yyzsetmessageid: <1238601532.59.0.0224673891196.issue2550534@psf.upfronthosting.co.za>
2009-04-01 15:58:52yyzsetrecipients: + yyz
2009-04-01 15:58:52yyzlinkissue2550534 messages
2009-04-01 15:58:51yyzcreate