New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MIMEMultipart _subparts constructor unusable #39866
Comments
It is not clear how to pass initial list of messages to My suggested patch implemets the single parameter way ((to apply the patch, use : example: >>> msgs = [MIMEText('a'),MIMEText('b')]
>>> MIMEMultipart('mixed',None,msgs[0],msgs[1])
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.3/email/MIMEMultipart.py",
line 35, in __init__
self.attach(*list(_subparts))
TypeError: attach() takes exactly 2 arguments (3 given)
>>> MIMEMultipart('mixed',None,msgs).as_string()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.3/email/Message.py", line 130,
in as_string
g.flatten(self, unixfrom=unixfrom)
File "/usr/lib/python2.3/email/Generator.py", line
102, in flatten
self._write(msg)
File "/usr/lib/python2.3/email/Generator.py", line
130, in _write
self._dispatch(msg)
File "/usr/lib/python2.3/email/Generator.py", line
156, in _dispatch
meth(msg)
File "/usr/lib/python2.3/email/Generator.py", line
230, in _handle_multipart
g.flatten(part, unixfrom=False)
File "/usr/lib/python2.3/email/Generator.py", line
102, in flatten
self._write(msg)
File "/usr/lib/python2.3/email/Generator.py", line
130, in _write
self._dispatch(msg)
File "/usr/lib/python2.3/email/Generator.py", line
147, in _dispatch
main = msg.get_content_maintype()
AttributeError: 'list' object has no attribute
'get_content_maintype'
>>> |
Logged In: YES This refers to the email package... To my example I should have added at the beginning:
|
Logged In: YES Your patch seems right since it implements what's |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: