[Python-checkins] CVS: python/dist/src/Lib/encodings utf_16.py,1.2,1.3 utf_16_be.py,1.1,1.2 utf_16_le.py,1.1,1.2
M.-A. Lemburg
lemburg@users.sourceforge.net
Fri, 05 Apr 2002 04:12:03 -0800
Update of /cvsroot/python/python/dist/src/Lib/encodings
In directory usw-pr-cvs1:/tmp/cvs-serv32431
Modified Files:
utf_16.py utf_16_be.py utf_16_le.py
Log Message:
Fix for bug #222395: UTF-16 et al. don't handle .readline().
They now raise an NotImplementedError to hint to the truth ;-)
Index: utf_16.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/encodings/utf_16.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** utf_16.py 19 Jun 2001 20:07:51 -0000 1.2
--- utf_16.py 5 Apr 2002 12:12:00 -0000 1.3
***************
*** 54,57 ****
--- 54,60 ----
return codecs.StreamReader.read(self, size)
+ def readline(self, size=None):
+ raise NotImplementedError, '.readline() is not implemented for UTF-16'
+
### encodings module API
Index: utf_16_be.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/encodings/utf_16_be.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** utf_16_be.py 10 Mar 2000 23:17:24 -0000 1.1
--- utf_16_be.py 5 Apr 2002 12:12:00 -0000 1.2
***************
*** 22,26 ****
class StreamReader(Codec,codecs.StreamReader):
! pass
### encodings module API
--- 22,28 ----
class StreamReader(Codec,codecs.StreamReader):
!
! def readline(self, size=None):
! raise NotImplementedError, '.readline() is not implemented for UTF-16-BE'
### encodings module API
Index: utf_16_le.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/encodings/utf_16_le.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** utf_16_le.py 10 Mar 2000 23:17:24 -0000 1.1
--- utf_16_le.py 5 Apr 2002 12:12:00 -0000 1.2
***************
*** 22,26 ****
class StreamReader(Codec,codecs.StreamReader):
! pass
### encodings module API
--- 22,28 ----
class StreamReader(Codec,codecs.StreamReader):
!
! def readline(self, size=None):
! raise NotImplementedError, '.readline() is not implemented for UTF-16-LE'
### encodings module API