-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Labels
1.bugAn error has been encountered that is preventing utilization.An error has been encountered that is preventing utilization.area:messageIssue relates to the MIME e-mail Message object representation.Issue relates to the MIME e-mail Message object representation.org:good-first-issueGood for newcomers to the project to tackle.Good for newcomers to the project to tackle.
Description
If you try to be immutable, it doesn't like you.
Works fine.
In [4]: Message(author="[email protected]", to=["[email protected]"])
Out[4]: <marrow.mailer.message.Message at 0x7fe136bd3590>
Dies horribly. Seems to go down a different code path and expects a 2-tuple of name and email. But that wasn't what was intended at all -- should just be a list of emails.
In [5]: Message(author="[email protected]", to=("[email protected]",))
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-5-a713a363d72b> in <module>()
----> 1 Message(author="[email protected]", to=("[email protected]",))
/home/lex/local/lib/python2.7/site-packages/marrow/mailer/message.pyc in __init__(self, author, to, subject, **kw)
86
87 if to is not None:
---> 88 self.to = to
89
90 if subject is not None:
/home/lex/local/lib/python2.7/site-packages/marrow/mailer/message.pyc in __setattr__(self, name, value)
99 def __setattr__(self, name, value):
100 """Set the dirty flag as properties are updated."""
--> 101 object.__setattr__(self, name, value)
102 if name not in ('bcc', '_id', '_dirty', '_processed'):
103 object.__setattr__(self, '_dirty', True)
/home/lex/local/lib/python2.7/site-packages/marrow/mailer/address.pyc in __set__(self, instance, value)
220 def __set__(self, instance, value):
221 if not isinstance(value, self.cls):
--> 222 value = self.cls(value)
223
224 setattr(instance, self.attr, value)
/home/lex/local/lib/python2.7/site-packages/marrow/mailer/address.pyc in __init__(self, addresses, encoding)
137
138 elif isinstance(addresses, tuple):
--> 139 self.append(Address(addresses, encoding=encoding))
140 return
141
/home/lex/local/lib/python2.7/site-packages/marrow/mailer/address.pyc in __init__(self, name_or_email, email, encoding)
37 if isinstance(name_or_email, (tuple, list)):
38 self.name = unicodestr(name_or_email[0], encoding)
---> 39 self.address = unicodestr(name_or_email[1], encoding)
40
41 elif isinstance(name_or_email, bytes):
IndexError: tuple index out of range
Versions:
$ pip freeze | grep marrow
marrow.interface==1.0.1
marrow.mailer==4.0.1
marrow.util==1.2.3
pyramid-marrowmailer==0.1
nezda, jplehmann and nashley
Metadata
Metadata
Assignees
Labels
1.bugAn error has been encountered that is preventing utilization.An error has been encountered that is preventing utilization.area:messageIssue relates to the MIME e-mail Message object representation.Issue relates to the MIME e-mail Message object representation.org:good-first-issueGood for newcomers to the project to tackle.Good for newcomers to the project to tackle.