diff --git a/Lib/StringIO.py b/Lib/StringIO.py index 334bf853a2c..6952b1a999e 100644 --- a/Lib/StringIO.py +++ b/Lib/StringIO.py @@ -129,6 +129,8 @@ def write(self, s): self.buflist = [] self.buflist = [self.buf[:self.pos], s, self.buf[newpos:]] self.buf = '' + if newpos > self.len: + self.len = newpos else: self.buflist.append(s) self.len = newpos