[issue28881] int no attribute 'lower' iterating email.Message

2020-11-30 Thread Irit Katriel
Irit Katriel added the comment: Python 2-only issue. -- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker ___ __

[issue28881] int no attribute 'lower' iterating email.Message

2016-12-05 Thread R. David Murray
R. David Murray added the comment: I had no memory that __iter__ wasn't implemented in python2, thanks Martin. So, this isn't really a bug, though one could argue it should be mentioned explicitly in the 2.7 docs, since it is definitely counter-intuitive to a python programmer. -- _

[issue28881] int no attribute 'lower' iterating email.Message

2016-12-05 Thread Martin Panter
Martin Panter added the comment: The __iter__() method was added by Barry in : “Added an __iter__() to email.message.Message for iterating over the message’s headers.” On the other hand,

[issue28881] int no attribute 'lower' iterating email.Message

2016-12-05 Thread Martin Panter
Changes by Martin Panter : -- title: int no attribute 'lower' iterating email.Messasge -> int no attribute 'lower' iterating email.Message ___ Python tracker ___ ___

[issue28881] int no attribute 'lower' iterating email.Messasge

2016-12-05 Thread Martin Panter
Martin Panter added the comment: You just need a messsage object with one or more header fields: >>> msg = message_from_string("Name: value\r\n\r\n") >>> for m in msg: ... pass ... AttributeError: 'int' object has no attribute 'lower' Python 2 does not implement __iter__(), so it is the de

[issue28881] int no attribute 'lower'

2016-12-05 Thread R. David Murray
R. David Murray added the comment: It looks like your 'name' variable holds an integer, not a string giving a header name. -- ___ Python tracker ___

[issue28881] int no attribute 'lower'

2016-12-05 Thread R. David Murray
R. David Murray added the comment: Oh, I think I misread your traceback. Can you provide the actual code you are running, please? And probably the message you are parsing, as well. -- ___ Python tracker

[issue28881] int no attribute 'lower'

2016-12-05 Thread Vitold S
New submission from Vitold S: I have MIME message and parse content. Later I walk on message headers by call for and receive follow traceback: Traceback (most recent call last): ... for m in msg: (msg is email.message.Message instance) File "C:\Python27\lib\email\message.py", line 294, i