diff -r b88525a8c01d Lib/codecs.py --- a/Lib/codecs.py Thu Jul 03 06:25:10 2014 +0300 +++ b/Lib/codecs.py Thu Jul 03 14:47:11 2014 +0100 @@ -385,7 +385,8 @@ stream to recover state. """ - pass + if hasattr(self.stream, "flush"): + self.stream.flush() def seek(self, offset, whence=0): self.stream.seek(offset, whence)