Message82064
| Author |
miwa |
| Recipients |
miwa |
| Date |
2009年02月14日.14:19:16 |
| SpamBayes Score |
0.0016854185 |
| Marked as misclassified |
No |
| Message-id |
<1234621158.53.0.153253851523.issue5259@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Issue #<3921> may be the same problem.
Sending Gmail by smtplib fails on Python 3.0 and 3.0.1.
It seems to be exist two problems in encode_plain function in smtplib.py:
* parameter of encode_base64 must be bytes, not str,
* by default, encode_base64 adds extra newline.
The following is an example of patch.
# original version
def encode_plain(user, password):
return encode_base64("0円%s0円%s" % (user, password))
# fixed version. Note that "eol=''" is given in Python 2.6's smtplib.
def encode_plain(user, password):
s = "0円%s0円%s" % (user, password)
return encode_base64(s.encode('ascii'), eol='') |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2009年02月14日 14:19:18 | miwa | set | recipients:
+ miwa |
| 2009年02月14日 14:19:18 | miwa | set | messageid: <1234621158.53.0.153253851523.issue5259@psf.upfronthosting.co.za> |
| 2009年02月14日 14:19:17 | miwa | link | issue5259 messages |
| 2009年02月14日 14:19:16 | miwa | create |
|