[pypy-issue] Issue #2314: RuntimeError: maximum recursion depth exceeded when altering sys.path with PYTHONIOENCODING set (pypy/pypy)

John Vandenberg issues-reply at bitbucket.org
Sun May 29 13:23:47 EDT 2016


New issue 2314: RuntimeError: maximum recursion depth exceeded when altering sys.path with PYTHONIOENCODING set
https://bitbucket.org/pypy/pypy/issues/2314/runtimeerror-maximum-recursion-depth

John Vandenberg:

With the sample script below, it works if PYTHONIOENCODING is not used, but fails when it is set with RuntimeError on v2.4.0-v5.1.1.

```python
# -*- coding: utf-8  -*-
u"""Foobar."""

import sys

sys.path = (u'.', ) + tuple(sys.path[1:])

def help():
    print(__doc__)

if __name__ == '__main__':
    help()
```

Sample code here: https://github.com/jayvdb/my-ci-test/tree/8abaffadb50abb95fe256a87a5443cba08bcb4c3

Test results here: https://travis-ci.org/jayvdb/my-ci-test/builds/133756245

```bash
$ python pwb.py
Foobar.
$ PYTHONIOENCODING=UTF8 python pwb.py
RuntimeError: maximum recursion depth exceeded
```

Removing use of `__doc__` or alteration of `sys.path` 'fixes' the problem.




More information about the pypy-issue mailing list