[Patches] [Patch #102698] Fix for StreamReader bug

noreply@sourceforge.net noreply@sourceforge.net
Thu, 04 Jan 2001 07:48:23 -0800


Patch #102698 has been updated. 

Project: python
Category: library
Status: Open
Submitted by: akuchling
Assigned to : lemburg
Summary: Fix for StreamReader bug

Follow-Ups:

Date: 2001-Jan-04 07:48
By: gvanrossum

Comment:
Marc-Andre, would you mind checking this in?
-------------------------------------------------------

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
-------------------------------------------------------

Date: 2000-Dec-07 01:14
By: nobody

Comment:
The patch looks OK to me.

-- Marc-Andre
-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=102698&group_id=5470