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.

Title: test_smtplib failures (caused by asyncore)
Type: Stage:
Components: Versions: Python 3.0
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: nobody Nosy List: christian.heimes, gvanrossum, loewis, skip.montanaro, twouters
Priority: normal Keywords: patch

Created on 2007-08-30 23:53 by twouters, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
asyncore.diff twouters, 2007-08-30 23:53
Messages (11)
msg55520 - (view) Author: Thomas Wouters (twouters) * (Python committer) Date: 2007-08-30 23:53
test_smtplib fails because asyncore uses bytes(data) where data may be
bytes or str or some undefined type. The attached patch fixes it to the
extend that test_smtplib works again (plus a small fix in test_smtplib
itself.) I'm not sure if this is the right thing to do -- maybe it
should be using iso-8859-1, or maybe asyncore and asynchat should be
ripped out by the roots and burned at the stake.
msg55521 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-08-31 00:18
Great, please check it in.  This is close to what I had sitting
somewhere, but I hadn't finished it.
msg55522 - (view) Author: Thomas Wouters (twouters) * (Python committer) Date: 2007-08-31 00:20
Checked in.
msg55525 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-08-31 06:13
I think it's incorrect: asynchat operates on bytes, not strings, as it
directly interfaces with the socket, and no encoding is specified for
the protocol.

So, IMO, callers should be expected to pass bytes only, as terminator
and as data.
msg55532 - (view) Author: Thomas Wouters (twouters) * (Python committer) Date: 2007-08-31 11:12
I agree, but the change wasn't actually mine. I merely adjusted the
already-implemented strategy to the fact that bytes(str) no longer
works. I think the original change was Jeremy H's.
msg55548 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-09-01 02:19
(Reopening given recent discussion.)
msg57680 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-11-20 01:18
Guido, what needs to be done here?
msg57739 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-11-21 20:02
I have no idea. I'm no asynchat expert. Let Thomas look into this once
he's back from vacation.
msg58207 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-12-05 05:48
Thomas, ping?  What do you think of Martin's claim that the fix is
msg58209 - (view) Author: Thomas Wouters (twouters) * (Python committer) Date: 2007-12-05 08:06
I thought I already had, in my reply to Martin and the original comment:
he's right, but I don't care about asyncore or asynchat. I merely
perpetuated the fix that was already in place. The real 'fix' is to
teach both modules about unicode; have them handle in bytes, and add a
new API for strings (in which the user has to supply encodings.) But I
don't think asyncore and asynchat are worth keeping, let alone fixing,
so I'm not the right person to look at this.
msg58220 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-12-05 17:14
OK, closing.  I see plenty of mention of these two modules in the lists,
so maybe someone else wants to take a whack at it.  I'll post to python-dev.
Date User Action Args
2022-04-11 14:56:26adminsetgithub: 45408
2008-01-06 22:29:44adminsetkeywords: - py3k
versions: Python 3.0
2007-12-05 17:44:26georg.brandlsetstatus: open -> closed
resolution: wont fix
2007-12-05 17:14:31gvanrossumsetpriority: high -> normal
nosy: - nobody
messages: + msg58220
keywords: + py3k
2007-12-05 08:06:28twouterssetassignee: twouters -> nobody
nosy: + nobody
2007-12-05 08:06:22twouterssetmessages: + msg58209
2007-12-05 05:48:52gvanrossumsetmessages: + msg58207
2007-11-25 22:52:36skip.montanarosetnosy: + skip.montanaro
2007-11-21 20:02:35gvanrossumsetmessages: + msg57739
2007-11-20 01:18:01christian.heimessetnosy: + christian.heimes
messages: + msg57680
2007-09-17 06:39:33jafosetpriority: high
2007-09-01 02:19:58gvanrossumsetstatus: closed -> open
resolution: fixed -> (no value)
messages: + msg55548
2007-08-31 11:12:43twouterssetmessages: + msg55532
2007-08-31 06:13:20loewissetnosy: + loewis
messages: + msg55525
2007-08-31 00:20:22twouterssetstatus: open -> closed
resolution: accepted -> fixed
messages: + msg55522
2007-08-31 00:18:46gvanrossumsetassignee: gvanrossum -> twouters
resolution: accepted
messages: + msg55521
2007-08-31 00:17:46gvanrossumsetversions: + Python 3.0
2007-08-30 23:53:48twouterscreate