alberto casado martín shcwpwhcfkpojdktshcgmailcom hi first sorry isnt list post sorry english subject says im problems attached email try get email object reading attached file python process gets hang gets cpu debuged code find happens found _parsegen method feedparser class know email format wrong dont know python hangs following paste code showing hangs def _parsegenself create new message start parsing headers self_new_message headers collect headers searching line doesnt match rfc 2822 header continuation pattern including empty line line self_input line needmoredata yield needmoredata continue headerrematchline saw rfc defined headerbody separator ie newline throw away otherwise line part body push back nlcrematchline self_inputunreadlineline break headersappendline done headers parse figure supposed see body message self_parse_headersheaders headersonly parsing backwards compatibility hack necessary older parser could throw errors remaining lines input thrown message body self_headersonly lines true line self_inputreadline line needmoredata yield needmoredata continue line break linesappendline self_curset_payloademptystringjoinlines return self_curget_content_type messagedeliverystatus point hangs strat get cpu process messagedeliverystatus contains blocks headers separated blank line well represent header block separate nested message object processing bit different standard message types body nested messages blank line separates subparts workaround problem adding line _parse_headers method def _parse_headersself lines passed list lines make headers current msg lastheader lastvalue lineno line enumeratelines check continuation line0 lastheader first line headers continuation illegal lets note defect store illegal line ignore purposes headers defect errorsfirstheaderlineiscontinuationdefectline self_curdefectsappenddefect continue linestrip continuation line empty add line header lastvalueappendline continue lastheader dont know hangs im sure line works tried parse email python 233 sunos python 233 gcc python 251 sunosgcc windows xp linux suse 10 alway result bash300 python python 251 r25154863 feb 28 2008 074825 gcc 346 sunos5 type help copyright credits license information import email fp openrarotxt mail emailmessage_from_filefp never return dont know someone tell happening best regards alberto casado thu 07 aug 2008 104434 0200 pythondev python hangs parsing badformed email