diff -up Python-2.7.3/Lib/StringIO.py.old Python-2.7.3/Lib/StringIO.py --- Python-2.7.3/Lib/StringIO.py.old 2013-10-10 11:47:18.165660213 +0200 +++ Python-2.7.3/Lib/StringIO.py 2013-10-10 11:49:00.981343754 +0200 @@ -158,7 +158,7 @@ class StringIO: newpos = self.len else: newpos = i+1 - if length is not None and length > 0: + if length >= 0: if self.pos + length < newpos: newpos = self.pos + length r = self.buf[self.pos:newpos]