diff options
Diffstat (limited to 'Lib/codecs.py')
-rw-r--r-- | Lib/codecs.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/codecs.py b/Lib/codecs.py index 932f01b..6895a22 100644 --- a/Lib/codecs.py +++ b/Lib/codecs.py @@ -274,7 +274,10 @@ class StreamReader(Codec): while True: # can the request can be satisfied from the character buffer? if chars < 0: - if self.charbuffer: + if size < 0: + if self.charbuffer: + break + elif len(self.charbuffer) >= size: break else: if len(self.charbuffer) >= chars: |