This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Pilessio
Recipients Pilessio
Date 2015-01-26.12:41:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1422276063.41.0.625016569735.issue23323@psf.upfronthosting.co.za>
In-reply-to
Content
In example when appending a message with more than one flag in a tuple with imaplib:

print flags
('\\Answered', '\\Seen')

connection.append('INBOX', flags, date, msg)


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-42-832414ffe4b5> in <module>()
----> 1 connection.append('INBOX', flags, date, msg[1][0][1])

/usr/lib/python2.7/imaplib.py in append(self, mailbox, flags, date_time, message)
    326         if flags:
    327             if (flags[0],flags[-1]) != ('(',')'):
--> 328                 flags = '(%s)' % flags
    329         else:
    330             flags = None

TypeError: not all arguments converted during string formatting


When I have only one flag to append:

print flags
Out[70]: ('\\Answered',)

connection.append('INBOX', flags, date, msg)
Out[74]: ('OK', ['[APPENDUID 1 1012] APPEND completed'])

Any ideas?

Thanks
History
Date User Action Args
2015-01-26 12:41:03Pilessiosetrecipients: + Pilessio
2015-01-26 12:41:03Pilessiosetmessageid: <1422276063.41.0.625016569735.issue23323@psf.upfronthosting.co.za>
2015-01-26 12:41:03Pilessiolinkissue23323 messages
2015-01-26 12:41:02Pilessiocreate