Author hdiogenes
Recipients barry, benjamin.peterson, brett.cannon, hdiogenes, rhettinger
Date 2008-06-07.03:28:35
SpamBayes Score 0.00403151
Marked as misclassified No
Message-id <1212809328.58.0.150360591536.issue2848@psf.upfronthosting.co.za>
In-reply-to
Content
Raymond, thanks for the parser solution! It worked -- just broke some 
tests because of the nature of FeedParser. While rfc822.Message can read 
the file and stop at some point in the middle (meaning that self.fp can 
still be read), FeedParser will always read the whole file *and* close 
it, even if setting _headersonly to True. This is the same problem that 
I had to work around on issue 2849. I'm attaching a patch that 
demonstrates it: lots of tests giving "I/O operation on closed file."

Right now I can think of two options:
 * Working around it, again (don't know how)
 * Implement some flag in FeedParser to make it consume only the headers 
and leave the file open.

Any other idea?

Oh, and if you think it's better not to mess with the name of other 
methods like getheader, that's fine by me. It was only a suggestion, 
after all. ;)
History
Date User Action Args
2008-06-07 03:28:49hdiogenessetspambayes_score: 0.00403151 -> 0.00403151
recipients: + hdiogenes, barry, brett.cannon, rhettinger, benjamin.peterson
2008-06-07 03:28:48hdiogenessetspambayes_score: 0.00403151 -> 0.00403151
messageid: <1212809328.58.0.150360591536.issue2848@psf.upfronthosting.co.za>
2008-06-07 03:28:46hdiogeneslinkissue2848 messages
2008-06-07 03:28:45hdiogenescreate