This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ccgus
Recipients ccgus, loewis
Date 2008-11-24.06:26:28
SpamBayes Score 9.752369e-09
Marked as misclassified No
Message-id <1227507990.91.0.278631503331.issue4403@psf.upfronthosting.co.za>
In-reply-to
Content
Encoding the message first doesn't work either:

>>> import smtplib
>>> server = smtplib.SMTP("localhost")
>>> server.sendmail("gus@flyingmeat.com", "gus@flyingmeat.com", "Ümlaut".encode("UTF-8"))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mu.org/home/gus/unix/python3/lib/python3.0/smtplib.py", line 713, in sendmail
    (code,resp) = self.data(msg)
  File "/home/mu.org/home/gus/unix/python3/lib/python3.0/smtplib.py", line 477, in data
    q = quotedata(msg)
  File "/home/mu.org/home/gus/unix/python3/lib/python3.0/smtplib.py", line 157, in quotedata
    re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data))
  File "/home/mu.org/home/gus/unix/python3/lib/python3.0/re.py", line 165, in sub
    return _compile(pattern, 0).sub(repl, string, count)
TypeError: can't use a string pattern on a bytes-like object

Should a check be done in data() first, before it tries to try string operations on it?
History
Date User Action Args
2008-11-24 06:26:30ccgussetrecipients: + ccgus, loewis
2008-11-24 06:26:30ccgussetmessageid: <1227507990.91.0.278631503331.issue4403@psf.upfronthosting.co.za>
2008-11-24 06:26:30ccguslinkissue4403 messages
2008-11-24 06:26:28ccguscreate