Fix for bug #222395: UTF-16 et al. don't handle .readline().

They now raise an NotImplementedError to hint to the truth ;-)
This commit is contained in:
Marc-André Lemburg 2002-04-05 12:12:00 +00:00
parent ffdd22f1af
commit 3ccb09cba3
3 changed files with 9 additions and 2 deletions

View File

@ -53,6 +53,9 @@ class StreamReader(Codec,codecs.StreamReader):
self.bom_read = 1
return codecs.StreamReader.read(self, size)
def readline(self, size=None):
raise NotImplementedError, '.readline() is not implemented for UTF-16'
### encodings module API
def getregentry():

View File

@ -21,7 +21,9 @@ class StreamWriter(Codec,codecs.StreamWriter):
pass
class StreamReader(Codec,codecs.StreamReader):
pass
def readline(self, size=None):
raise NotImplementedError, '.readline() is not implemented for UTF-16-BE'
### encodings module API

View File

@ -21,7 +21,9 @@ class StreamWriter(Codec,codecs.StreamWriter):
pass
class StreamReader(Codec,codecs.StreamReader):
pass
def readline(self, size=None):
raise NotImplementedError, '.readline() is not implemented for UTF-16-LE'
### encodings module API