[PyPy-issue] [issue540] distutils byte_compile fails when installing suds

Amaury Forgeot d Arc pypy-dev-issue at codespeak.net
Thu May 20 13:56:49 CEST 2010

Amaury Forgeot d Arc <amauryfa at gmail.com> added the comment:

I did not try to reproduce the error, but here is a probable cause:

- in module/posix/app_posix.py, pypy implements os.fdopen by calling file.fdopen() (which 
does not exist in CPython, it's a pypy extension); this classmethod is implemented in 
- in my copy of setuptools, setuptools/sandbox.py replaces __builtins__.file with a custom 
function (it restricts writes to a single directory)

setuptools seems to suppose that the only way to use __builtins__.file is to __call__ it, 
this may be the case with CPython, but pypy breaks the assumption with this classmethod.

A solution is to export fdopen as a function in the _file module, and use it in 
app_posix.py: "import _file; _file.fdopen(...)"

PyPy development tracker <pypy-dev-issue at codespeak.net>

More information about the Pypy-issue mailing list