[pypy-issue] Issue #3013: os.rename crashes rpython when you pass in a byte string filename (pypy/pypy)

Milton at bitbucket.org Milton at bitbucket.org
Mon May 6 21:56:18 EDT 2019


New issue 3013: os.rename crashes rpython when you pass in a byte string filename
https://bitbucket.org/pypy/pypy/issues/3013/osrename-crashes-rpython-when-you-pass-in

Milton Thomas:

To reproduce:

```
import os
os.rename( bytes("a", "utf8"), bytes("b", "utf8"))
```

result:

```
RPython traceback:
  File "implement_8.c", line 402, in BuiltinActivation_UwS_ObjSpace_W_Root_W_Root_kwo_3
  File "pypy_module_posix.c", line 18574, in dispatch__star_0_2
Fatal RPython error: AssertionError
```

Discovered this because a library in the wild opened a file in read-binary mode and pulled the file path out as bytes.

Works in CPython 3.7.3.

OS is Windows 10, PyPy version is PyPy3.6 7.1.1.




More information about the pypy-issue mailing list