[New-bugs-announce] [issue1380] fix for test_asynchat and test_asyncore on pep3137 branch

Adam Hupp report at bugs.python.org
Sat Nov 3 19:06:42 CET 2007

New submission from Adam Hupp:

The attached patch resolves test failues in test_asynchat and

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.

components: Library (Lib), Tests
files: pep3137-asynfix.patch
messages: 57086
nosy: hupp
severity: normal
status: open
title: fix for test_asynchat and test_asyncore on pep3137 branch
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file8684/pep3137-asynfix.patch

Tracker <report at bugs.python.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pep3137-asynfix.patch
Type: application/octet-stream
Size: 1469 bytes
Desc: not available
Url : http://mail.python.org/pipermail/new-bugs-announce/attachments/20071103/724dd10b/attachment.obj 

More information about the New-bugs-announce mailing list