From 3ccb09cba3e966d50f108406a86b9b9cac56c66e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lemburg?= Date: Fri, 5 Apr 2002 12:12:00 +0000 Subject: Fix for bug #222395: UTF-16 et al. don't handle .readline(). They now raise an NotImplementedError to hint to the truth ;-) --- Lib/encodings/utf_16.py | 3 +++ Lib/encodings/utf_16_be.py | 4 +++- Lib/encodings/utf_16_le.py | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Lib/encodings/utf_16.py b/Lib/encodings/utf_16.py index 72be072..2c2638f 100644 --- a/Lib/encodings/utf_16.py +++ b/Lib/encodings/utf_16.py @@ -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(): diff --git a/Lib/encodings/utf_16_be.py b/Lib/encodings/utf_16_be.py index 2fd28da..63ac608 100644 --- a/Lib/encodings/utf_16_be.py +++ b/Lib/encodings/utf_16_be.py @@ -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 diff --git a/Lib/encodings/utf_16_le.py b/Lib/encodings/utf_16_le.py index fea9122..aa9d6f5 100644 --- a/Lib/encodings/utf_16_le.py +++ b/Lib/encodings/utf_16_le.py @@ -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 -- cgit v0.12