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.

classification
Title: fix for test_asynchat and test_asyncore on pep3137 branch
Type: behavior Stage:
Components: Library (Lib), Tests Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, hupp
Priority: normal Keywords: patch

Created on 2007-11-03 18:06 by hupp, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pep3137-asynfix.patch hupp, 2007-11-03 18:06
Messages (2)
msg57086 - (view) Author: Adam Hupp (hupp) Date: 2007-11-03 18:06
The attached patch resolves test failues in test_asynchat and
test_asyncore.

The asynchat failure was due to interpolating a byte string into a
unicode string using %s.  This resulted in a b'' byte representation
in the final string.  The fix is to use string constants instead of
byte constants.  The result is encoded to bytes later on.

The asyncore failure was due to an explicit isinstance(data, bytes)
check on the result of recv.  The actual type in this case was buffer.
I've removed the check since the next line calls

data.replace(b'\n', b'')

This all should fail for anything thats not a buffer or bytes.
msg57087 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-11-03 18:30
Applied in r58831

Thanks!
History
Date User Action Args
2022-04-11 14:56:27adminsetgithub: 45721
2008-01-06 22:29:45adminsetkeywords: - py3k
versions: Python 3.0
2007-11-03 18:30:55christian.heimessetstatus: open -> closed
keywords: + py3k, patch
messages: + msg57087
resolution: fixed
nosy: + christian.heimes
2007-11-03 18:06:42huppcreate