[pypy-issue] Issue #1902: PyPy3: "IOError: [Errno 22] Invalid argument" with buffered rw file IO (pypy/pypy)

Christoph Reiter issues-reply at bitbucket.org
Fri Oct 24 15:42:27 CEST 2014


New issue 1902: PyPy3: "IOError: [Errno 22] Invalid argument" with buffered rw file IO
https://bitbucket.org/pypy/pypy/issue/1902/pypy3-ioerror-errno-22-invalid-argument

Christoph Reiter:

With PyPy 2.4.0:

```
#!python

with open("foo.data", "w+b", 4096) as f:
    f.write(b"\xff" * 13569)
    f.flush()
    f.seek(0, 0)
    f.read(1)
    f.seek(-1, 1)
    f.write(b"")  # pypy3: IOError: [Errno 22] Invalid argument
```

```
#!python

with open("foo.data", "w+b", 4096) as f:
    f.write(b"\xff" * 13569)
    f.flush()
    f.seek(0, 0)

    f.read(1)
    f.seek(-1, 1)
    f.write(b"\xff")
    f.seek(1, 0)
    f.read(4123)
    f.seek(-4123, 1) # IOError: [Errno 22] Invalid argument
```





More information about the pypy-issue mailing list