[issue25640] Message.is_attachment() throws exception

2015-11-16 Thread R. David Murray
R. David Murray added the comment: Ah, yes, that would do it. EmailMessage should definitely throw an error if it gets compat32 as a policy, that would have told you what you were doing "wrong". What you want to be doing is: msg = message_from_string(mystring, policy=default) That will get

[issue25640] Message.is_attachment() throws exception

2015-11-16 Thread Matthieu Pepin
Matthieu Pepin added the comment: Yes, I will make a small reproducer. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue25640] Message.is_attachment() throws exception

2015-11-16 Thread Matthieu Pepin
Matthieu Pepin added the comment: Ok I think the bug is not where I thought. First, my workaround does not work. Second, I use the following to generate my Message: message_from_string(s, _class=EmailMessage) Maybe the bug is in the parser? -- ___

[issue25640] Message.is_attachment() throws exception

2015-11-16 Thread R. David Murray
R. David Murray added the comment: I mean compat32. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue25640] Message.is_attachment() throws exception

2015-11-16 Thread R. David Murray
R. David Murray added the comment: Can you provide a minimum reproducer? It looks like you are somehow managing to use EmailMessage with the compat34 policy, which shouldn't happen unless you work at it, or I overlooked something. Perhaps EmailMessage should disallow setting policy to compat3

[issue25640] Message.is_attachment() throws exception

2015-11-16 Thread Matthieu Pepin
New submission from Matthieu Pepin: Message.is_attachment() throws the exception below: File "/usr/lib/python3.5/email/message.py", line 956, in is_attachment return False if c_d is None else c_d.content_disposition == 'attachment' AttributeError: 'str' object has no attribute 'content_disp