New issue 1966: When run in a chroot, pypy will sometimes fail to import 
builtin modules
https://bitbucket.org/pypy/pypy/issue/1966/when-run-in-a-chroot-pypy-will-sometimes

JakobKrainz:

When running in a chroot where $HOME is not set and 
/etc/passwd does not contain an entry for the current UID,
pypy 2.4.0 will fail to import some builtin modules.

More precisely, the script

```
#!python

a = raw_input()
b = raw_input()

n = a.count("x")

for x in range(n + 4):
        if eval(a, dict(x=x)) != eval(b, dict(x=x)):
                print "NOT EQUIVALENT"
                exit()
print "EQUIVALENT"
```

will produce the following output:


```
'import site' failed
Traceback (most recent call last):
  File "app_main.py", line 75, in run_toplevel
  File "K.py", line 9, in <module>
    exit()
NameError: global name 'exit' is not defined
```

Adding the current user to /etc/passwd or setting $HOME fixes this.




_______________________________________________
pypy-issue mailing list
pypy-issue@python.org
https://mail.python.org/mailman/listinfo/pypy-issue

Reply via email to