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
0b0ca0c3
Commit
0b0ca0c3
authored
Oct 17, 2010
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_httpservers: skip CGI tests if Python executable path is not encodable
parent
3ebc22a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
Lib/test/test_httpservers.py
Lib/test/test_httpservers.py
+14
-3
No files found.
Lib/test/test_httpservers.py
View file @
0b0ca0c3
...
...
@@ -295,9 +295,12 @@ class CGIHTTPServerTestCase(BaseTestCase):
def
setUp
(
self
):
BaseTestCase
.
setUp
(
self
)
self
.
cwd
=
os
.
getcwd
()
self
.
parent_dir
=
tempfile
.
mkdtemp
()
self
.
cgi_dir
=
os
.
path
.
join
(
self
.
parent_dir
,
'cgi-bin'
)
os
.
mkdir
(
self
.
cgi_dir
)
self
.
file1_path
=
None
self
.
file2_path
=
None
# The shebang line should be pure ASCII: use symlink if possible.
# See issue #7668.
...
...
@@ -309,6 +312,13 @@ class CGIHTTPServerTestCase(BaseTestCase):
self
.
file1_path
=
os
.
path
.
join
(
self
.
cgi_dir
,
'file1.py'
)
with
open
(
self
.
file1_path
,
'w'
)
as
file1
:
try
:
self
.
pythonexe
.
encode
(
file1
.
encoding
)
except
UnicodeEncodeError
:
self
.
tearDown
()
raise
self
.
skipTest
(
"Python executable path is not encodable to %s"
%
file1
.
encoding
)
file1
.
write
(
cgi_file1
%
self
.
pythonexe
)
os
.
chmod
(
self
.
file1_path
,
0o777
)
...
...
@@ -317,7 +327,6 @@ class CGIHTTPServerTestCase(BaseTestCase):
file2
.
write
(
cgi_file2
%
self
.
pythonexe
)
os
.
chmod
(
self
.
file2_path
,
0o777
)
self
.
cwd
=
os
.
getcwd
()
os
.
chdir
(
self
.
parent_dir
)
def
tearDown
(
self
):
...
...
@@ -325,8 +334,10 @@ class CGIHTTPServerTestCase(BaseTestCase):
os
.
chdir
(
self
.
cwd
)
if
self
.
pythonexe
!=
sys
.
executable
:
os
.
remove
(
self
.
pythonexe
)
os
.
remove
(
self
.
file1_path
)
os
.
remove
(
self
.
file2_path
)
if
self
.
file1_path
:
os
.
remove
(
self
.
file1_path
)
if
self
.
file2_path
:
os
.
remove
(
self
.
file2_path
)
os
.
rmdir
(
self
.
cgi_dir
)
os
.
rmdir
(
self
.
parent_dir
)
finally
:
...
...
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