This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author benjamin.peterson
Recipients benjamin.peterson
Date 2018-09-13.20:31:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1536870698.96.0.956365154283.issue34668@psf.upfronthosting.co.za>
In-reply-to
Content
test_prlimit tries to test that raising the hardlimit of an unprivileged process. It tries to raise the hardlimit of pid 1, which usually raises a PermissionError. However, if the tests are privileged, this test can't work. The test tries to avoid this by only running the test if os.geteuid() != 0. However, there are other cases. For example, if the test process isn't root but has CAP_SYS_RESOURCE. While we could check for these other cases, I think we should just delete this test. There's no special logic in the prlimit implementation for handling permission errors, so it's not adding much value.

======================================================================
FAIL: test_prlimit (test.test_resource.ResourceTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.ware-alpine/build/Lib/test/support/__init__.py", line 587, in wrapper
    return func(*args, **kw)
  File "/buildbot/buildarea/3.x.ware-alpine/build/Lib/test/test_resource.py", line 152, in test_prlimit
    1, resource.RLIMIT_AS)
AssertionError: PermissionError not raised by prlimit
History
Date User Action Args
2018-09-13 20:31:39benjamin.petersonsetrecipients: + benjamin.peterson
2018-09-13 20:31:38benjamin.petersonsetmessageid: <1536870698.96.0.956365154283.issue34668@psf.upfronthosting.co.za>
2018-09-13 20:31:38benjamin.petersonlinkissue34668 messages
2018-09-13 20:31:38benjamin.petersoncreate