Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b2cca00c
Commit
b2cca00c
authored
Nov 02, 2011
by
Charles-François Natali
Browse files
Options
Browse Files
Download
Plain Diff
Issue #13308: Fix test_httpservers failures when run as root.
parents
23e1ecbd
f7ed9fc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
Lib/test/test_httpservers.py
Lib/test/test_httpservers.py
+6
-2
No files found.
Lib/test/test_httpservers.py
View file @
b2cca00c
...
@@ -259,8 +259,9 @@ class SimpleHTTPServerTestCase(BaseTestCase):
...
@@ -259,8 +259,9 @@ class SimpleHTTPServerTestCase(BaseTestCase):
with
open
(
os
.
path
.
join
(
self
.
tempdir_name
,
'index.html'
),
'w'
)
as
f
:
with
open
(
os
.
path
.
join
(
self
.
tempdir_name
,
'index.html'
),
'w'
)
as
f
:
response
=
self
.
request
(
'/'
+
self
.
tempdir_name
+
'/'
)
response
=
self
.
request
(
'/'
+
self
.
tempdir_name
+
'/'
)
self
.
check_status_and_reason
(
response
,
200
)
self
.
check_status_and_reason
(
response
,
200
)
if
os
.
name
==
'posix'
:
# chmod() doesn't work as expected on Windows, and filesystem
# chmod won't work as expected on Windows platforms
# permissions are ignored by root on Unix.
if
os
.
name
==
'posix'
and
os
.
geteuid
()
!=
0
:
os
.
chmod
(
self
.
tempdir
,
0
)
os
.
chmod
(
self
.
tempdir
,
0
)
response
=
self
.
request
(
self
.
tempdir_name
+
'/'
)
response
=
self
.
request
(
self
.
tempdir_name
+
'/'
)
self
.
check_status_and_reason
(
response
,
404
)
self
.
check_status_and_reason
(
response
,
404
)
...
@@ -305,6 +306,9 @@ print("%%s, %%s, %%s" %% (form.getfirst("spam"), form.getfirst("eggs"),
...
@@ -305,6 +306,9 @@ print("%%s, %%s, %%s" %% (form.getfirst("spam"), form.getfirst("eggs"),
form.getfirst("bacon")))
form.getfirst("bacon")))
"""
"""
@
unittest
.
skipIf
(
hasattr
(
os
,
'geteuid'
)
and
os
.
geteuid
()
==
0
,
"This test can't be run reliably as root (issue #13308)."
)
class
CGIHTTPServerTestCase
(
BaseTestCase
):
class
CGIHTTPServerTestCase
(
BaseTestCase
):
class
request_handler
(
NoLogRequestHandler
,
CGIHTTPRequestHandler
):
class
request_handler
(
NoLogRequestHandler
,
CGIHTTPRequestHandler
):
pass
pass
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment