Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r71581:7c24973aa476 Date: 2014-05-19 10:27 +0200 http://bitbucket.org/pypy/pypy/changeset/7c24973aa476/
Log: Translation fix for 3777204fff8e diff --git a/pypy/module/_file/interp_file.py b/pypy/module/_file/interp_file.py --- a/pypy/module/_file/interp_file.py +++ b/pypy/module/_file/interp_file.py @@ -209,11 +209,13 @@ while size > 0: # "peeks" on the underlying stream to see how many chars # we can safely read without reading past an end-of-line - peeked = stream.peek() - pn = peeked.find("\n", 0, size) + startindex, peeked = stream.peek() + assert 0 <= startindex <= len(peeked) + endindex = startindex + size + pn = peeked.find("\n", startindex, endindex) if pn < 0: - pn = min(size-1, len(peeked)) - c = stream.read(pn + 1) + pn = min(endindex - 1, len(peeked)) + c = stream.read(pn - startindex + 1) if not c: break result.append(c) diff --git a/rpython/rlib/streamio.py b/rpython/rlib/streamio.py --- a/rpython/rlib/streamio.py +++ b/rpython/rlib/streamio.py @@ -554,7 +554,7 @@ else: difpos = offset if -self.pos <= difpos <= currentsize: - self.pos += difpos + self.pos += intmask(difpos) return if whence == 1: offset -= currentsize _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit