[Patches] [Patch #102698] Fix for StreamReader bug
noreply@sourceforge.net
noreply@sourceforge.net
Wed, 6 Dec 2000 17:53:55 -0800
Patch #102698 has been updated.
Project: python
Category: library
Status: Open
Submitted by: akuchling
Assigned to : bwarsaw
Summary: Fix for StreamReader bug
Follow-Ups:
Date: 2000-Dec-06 17:53
By: akuchling
Comment:
Fix for a bug reported in c.l.p by Wade Leftwich: StreamReader ignores
the errors parameter passed to its constructor:
import codecs
from StringIO import StringIO
encode, decode, reader, writer = codecs.lookup('UTF-8')
s = 'ab\346c'
print decode(s, 'replace')
# outputs (u'ab\uFFFDc', 4)
fh = StringIO(s)
sr = reader(fh, 'replace')
print repr(sr.read())
# dies with a UnicodeError exception
Randomly assigning to Barry -- this just needs a quick sanity check
-------------------------------------------------------
-------------------------------------------------------
For more info, visit:
http://sourceforge.net/patch/?func=detailpatch&patch_id=102698&group_id=5470