diff options
author | Marc-André Lemburg <mal@egenix.com> | 2002-04-05 12:12:00 (GMT) |
---|---|---|
committer | Marc-André Lemburg <mal@egenix.com> | 2002-04-05 12:12:00 (GMT) |
commit | 3ccb09cba3e966d50f108406a86b9b9cac56c66e (patch) | |
tree | 9072645189e91ee6500c0c66811ef80c9cb38691 /Lib | |
parent | ffdd22f1af66ffefc1b37b454b5df6ffacc5da61 (diff) | |
download | cpython-3ccb09cba3e966d50f108406a86b9b9cac56c66e.zip cpython-3ccb09cba3e966d50f108406a86b9b9cac56c66e.tar.gz cpython-3ccb09cba3e966d50f108406a86b9b9cac56c66e.tar.bz2 |
Fix for bug #222395: UTF-16 et al. don't handle .readline().
They now raise an NotImplementedError to hint to the truth ;-)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/encodings/utf_16.py | 3 | ||||
-rw-r--r-- | Lib/encodings/utf_16_be.py | 4 | ||||
-rw-r--r-- | 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 |