Title: test_prlimit from test_resource fails when building python3 inside systemd-nspawn environment
Type: Stage:
Components: Versions: Python 3.7, Python 3.6
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: cstratak, haypo, torsava
Priority: normal Keywords:

Created on 2017-08-07 16:43 by cstratak, last changed 2017-08-07 20:20 by haypo.

Messages (3)
msg299852 - (view) Author: Charalampos Stratakis (cstratak) * Date: 2017-08-07 16:43
FAIL: test_prlimit (test.test_resource.ResourceTest)
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-3.6.2/Lib/test/support/", line 556, in wrapper
    return func(*args, **kw)
  File "/builddir/build/BUILD/Python-3.6.2/Lib/test/", line 153, in test_prlimit
    1, resource.RLIMIT_AS)
AssertionError: PermissionError not raised by prlimit

I observed this issue when mock [0] the underlying build system we use in Fedora started using the systemd-nspawn container technology instead of chroot [1][2] in order to create a minimal build environment.

msg299853 - (view) Author: Tomas Orsava (torsava) * Date: 2017-08-07 16:55
So the issue seems to be that Python believes it's run without root privileges, but it's mistaken because it indeed has root.
msg299866 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2017-08-07 20:20
Maybe we should simply skip the test if the user is root? If os.getuid()==0.
Date User Action Args
2017-08-07 20:20:00hayposetnosy: + haypo
messages: + msg299866
2017-08-07 16:55:50torsavasetnosy: + torsava
messages: + msg299853
2017-08-07 16:43:22cstratakcreate