Is it an error in email.Header?

R

Roman Suzi

I was using Python module email.Header to decode headers and encountered
problems with some of the headers. One example is given below:

Python 2.3.4 (#1, May 27 2004, 15:48:35)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/var/tmp/python2.3-2.3.4-root/usr/lib/python2.3/email/Header.py",
line 113, in decode_header
email.Errors.HeaderParseError

While mailers decode Subject just fine... Is it a case of some
standard deviation?


Sincerely yours, Roman A.Suzi
 
M

Michel Claveau - abstraction méta-galactique non t

Hi !


decode_header not work for all cases of e-mails. Use try, and, if except,
try other decode fonction (utf-8, cp1252, etc.)
Then an header can to have more differents codages. Try to decompose the
item, and to decode each element. The elements are often separate with =?
and ?=



*sorry for my bad english*



Michel Claveau
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top