[issue2551066] Traceback in email gateway

Ralf Schlatterbeck <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
New submission from Ralf Schlatterbeck:

With python2 I'm getting a traceback in the email gateway when
processing an IMAP mailbox:

roundup@tux5:~$ roundup-mailgw /var/lib/tracker/tracker-home/ imap
[email protected]:verysecret@tux2
Traceback (most recent call last):
  File "/usr/local/bin/roundup-mailgw", line 6, in <module>
    run()
  File
"/usr/local/lib/python2.7/dist-packages/roundup/scripts/roundup_mailgw.py",
line 226, in run
    sys.exit(main(sys.argv))
  File
"/usr/local/lib/python2.7/dist-packages/roundup/scripts/roundup_mailgw.py",
line 220, in main
    cram)
  File "/usr/local/lib/python2.7/dist-packages/roundup/mailgw.py", line
1363, in do_imap
    self.handle_Message(message_from_bytes(s, RoundupMessage))
  File "/usr/lib/python2.7/email/__init__.py", line 57, in
message_from_string
    return Parser(*args, **kws).parsestr(s)
  File "/usr/lib/python2.7/email/parser.py", line 82, in parsestr
    return self.parse(StringIO(text), headersonly=headersonly)
TypeError: StringIO() argument 1 must be string or buffer, not _io.BytesIO


It looks to me like a BytesIO instance is passed to the email package
message_from_string (aliased in roundup to message_from_bytes for
python2) instead of bytes, so this should use getvalue() on the BytesIO
instance for passing to the email Parser.

Didn't anybody use the email gateway so far?
I wonder how this could last so long without being detected?

----------
assignee: schlatterbeck
components: Mail interface
messages: 6719
nosy: schlatterbeck
severity: normal
status: new
title: Traceback in email gateway
versions: 2.0.0alpha

_________________________________________________
Roundup tracker <[email protected]>
<https://issues.roundup-tracker.org/issue2551066>
_________________________________________________
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.