Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions Lib/test/test_httpservers.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,9 +593,18 @@ def test_html_escape_filename(self):
#!%s
import os

print("Content-type: text/plain")
print("X-ambv: was here")
print("Content-type: text/html")
print()
print(repr(os.environ))
print("<pre>")
for k, v in os.environ.items():
try:
k.encode('ascii')
v.encode('ascii')
except UnicodeEncodeError:
continue # see: BPO-44647
print(f"{k}={v}")
print("</pre>")
"""


Expand Down Expand Up @@ -850,8 +859,8 @@ def test_accept(self):
with self.subTest(headers):
res = self.request('/cgi-bin/file6.py', 'GET', headers=headers)
self.assertEqual(http.HTTPStatus.OK, res.status)
expected = f"'HTTP_ACCEPT': {expected!r}"
self.assertIn(expected.encode('ascii'), res.read())
expected = f"HTTP_ACCEPT={expected}".encode('ascii')
self.assertIn(expected, res.read())


class SocketlessRequestHandler(SimpleHTTPRequestHandler):
Expand Down