[pypy-issue] Issue #1887: Regression in 2.4.0, streamio. (pypy/pypy)

eric s issues-reply at bitbucket.org
Mon Oct 13 00:04:53 CEST 2014


New issue 1887: Regression in 2.4.0, streamio.
https://bitbucket.org/pypy/pypy/issue/1887/regression-in-240-streamio

eric s:

In Pillow, when dealing with multipage tiffs using libtiff, we have some code that is essentially:

```
#!python
fd = open(file)
stuff = fd.read()
libtiff_fd = os.dup(fd.fileno())
""" lib tiff does stuff with the file descriptor, then closes it"""

fd.tell()  # resyncs the file descriptor in py3, essentially a noop in py2
fd.seek(next_frame)  #  seek to the next frame to read metadata
stuff = fd.read()
```

The test that's failing is here: https://github.com/python-pillow/Pillow/blob/9634e437efeeda906ad6bfcc275b17732d64f32a/Tests/test_file_libtiff.py#L315

This worked in Pypy 2.3, Pypy2.4 fails at both the tell and the seek with an assertion error. 
Tell:
```
RPython traceback:
  File "implement_7.c", line 12162, in W_File_file_tell
  File "rpython_rlib_streamio.c", line 6936, in BufferingInputStream_tell
Fatal RPython error: AssertionError
```
Seek:
```
RPython traceback:
  File "implement_7.c", line 10766, in W_File_file_seek
  File "rpython_rlib_streamio.c", line 5743, in BufferingInputStream_seek
Fatal RPython error: AssertionError
```





More information about the pypy-issue mailing list