[New-bugs-announce] [issue13308] fix test_httpservers failures when run as root

Charles-François Natali report at bugs.python.org
Tue Nov 1 09:55:54 CET 2011

New submission from Charles-François Natali <neologix at free.fr>:

Here's a patch fixing test_httpservers failures when run as root (a couple buildbots are consistently failing on this, e.g. http://python.org/dev/buildbot/all/builders/x86 FreeBSD 7.2 3.x/builds/2282/steps/test/logs/stdio).
The test is failing for two reasons:
1) test_get does a chmod(0) on a directory, and checks that the server returns an error when requesting a file under this directory: unfortunately, filesystem permissions are ignored by root
2) CGI tests fail because they try to execute CGI scripts, created in a temporary directory: unfortunately, the temp directory is created as root with mkdtemp() (mode == 0700), and the http server changes to user "nobody" before running the scripts => EACCES

components: Tests
files: test_httpserver_root.diff
keywords: needs review, patch
messages: 146762
nosy: haypo, neologix, pitrou
priority: normal
severity: normal
stage: patch review
status: open
title: fix test_httpservers failures when run as root
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file23578/test_httpserver_root.diff

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list