[Python-bugs-list] [Bug #115907] Encoding of "=" by quopri.py module

noreply@sourceforge.net noreply@sourceforge.net
Tue, 3 Oct 2000 05:47:05 -0700

Bug #115907, was updated on 2000-Oct-03 05:47
Here is a current snapshot of the bug.

Project: Python
Category: Modules
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Summary: Encoding of "=" by quopri.py module

Details: While making an automated mail sending engine, I used the quopri.encode(...) for my multipart mails.
quopri.encode(...) converts "=" into "==" while the mail clients expect "=3D". Thus I got some problems reading such mails with Outlook Express 5 , Netscape Messenger (Linux) and StarOffice Mail (Linux). Especially when the HTML part of the mail contains hyperkinks <a href=...>...</a> that crash Outlook express. The others make a 404 HTTP error.
I run Python 1.5.2, but this bug/feature remains perhaps with Python 1.6 and Python 2.0bx cause I didn't notice any change log to the quopri module.
I found a workaround (fix ?) by changing the "quote" function of "quopri.py" to this:
==== quopri.py ====
def quote(c):
## if c == ESCAPE:
##  return ESCAPE * 2
## else:
  i = ord(c)
  return ESCAPE + HEX[i/16] + HEX[i%16]
==== end quopri.py ====
Now, the 3 above mentioned mail clients read correctly the raw text and html parts of my mails - including hyperlinks.
Is it a bug, a feature, or did I misuse "quopri" ?

For detailed info, follow this link: