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
fbe912b7
Commit
fbe912b7
authored
Aug 17, 2014
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #22165: Fixed test_undecodable_filename on non-UTF-8 locales.
parents
41a08e55
a64ce5d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
Lib/test/test_httpservers.py
Lib/test/test_httpservers.py
+3
-2
No files found.
Lib/test/test_httpservers.py
View file @
fbe912b7
...
...
@@ -272,6 +272,7 @@ class SimpleHTTPServerTestCase(BaseTestCase):
@
unittest
.
skipUnless
(
support
.
TESTFN_UNDECODABLE
,
'need support.TESTFN_UNDECODABLE'
)
def
test_undecodable_filename
(
self
):
enc
=
sys
.
getfilesystemencoding
()
filename
=
os
.
fsdecode
(
support
.
TESTFN_UNDECODABLE
)
+
'.txt'
with
open
(
os
.
path
.
join
(
self
.
tempdir
,
filename
),
'wb'
)
as
f
:
f
.
write
(
support
.
TESTFN_UNDECODABLE
)
...
...
@@ -279,9 +280,9 @@ class SimpleHTTPServerTestCase(BaseTestCase):
body
=
self
.
check_status_and_reason
(
response
,
200
)
quotedname
=
urllib
.
parse
.
quote
(
filename
,
errors
=
'surrogatepass'
)
self
.
assertIn
((
'href="%s"'
%
quotedname
)
.
encode
(
'utf-8'
,
'surrogateescape'
),
body
)
.
encode
(
enc
,
'surrogateescape'
),
body
)
self
.
assertIn
((
'>%s<'
%
html
.
escape
(
filename
))
.
encode
(
'utf-8'
,
'surrogateescape'
),
body
)
.
encode
(
enc
,
'surrogateescape'
),
body
)
response
=
self
.
request
(
self
.
tempdir_name
+
'/'
+
quotedname
)
self
.
check_status_and_reason
(
response
,
200
,
data
=
support
.
TESTFN_UNDECODABLE
)
...
...
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