New submission from Alessio:
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
----------
components: Library (Lib)
messages: 234738
nosy: Pilessio
priority: normal
severity: normal
status: open
title: Issue with imaplib and append messages passing a tuple with flags
versions: Python 2.7
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue23323>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com