cpython: f180a9156cc8 (original) (raw)

Mercurial > cpython

changeset 92125:f180a9156cc8 3.4

Issue #22165: SimpleHTTPRequestHandler now supports undecodable file names. [#22165]

Serhiy Storchaka storchaka@gmail.com
date Sun, 17 Aug 2014 08:22:11 +0300
parents d51e739004bc
children 3153a400b739 a894b629bbea
files Lib/http/server.py Lib/test/test_httpservers.py Misc/NEWS
diffstat 3 files changed, 36 insertions(+), 4 deletions(-)[+] [-] Lib/http/server.py 19 Lib/test/test_httpservers.py 19 Misc/NEWS 2

line wrap: on

line diff

--- a/Lib/http/server.py +++ b/Lib/http/server.py @@ -747,7 +747,12 @@ class SimpleHTTPRequestHandler(BaseHTTPR return None list.sort(key=lambda a: a.lower()) r = []

@@ -769,9 +774,11 @@ class SimpleHTTPRequestHandler(BaseHTTPR displayname = name + "@" # Note: a link to a directory displays with @ and links with / r.append('

  • %s
  • '

    @@ -794,7 +801,11 @@ class SimpleHTTPRequestHandler(BaseHTTPR path = path.split('#',1)[0] # Don't forget explicit trailing slash when normalizing. Issue17324 trailing_slash = path.rstrip().endswith('/')

    --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -14,6 +14,7 @@ import re import base64 import shutil import urllib.parse +import html import http.client import tempfile from io import BytesIO @@ -266,6 +267,24 @@ class SimpleHTTPServerTestCase(BaseTestC self.assertIsNotNone(response.reason) if data: self.assertEqual(data, body)

    +

    def test_get(self): #constructs the path relative to the root directory of the HTTPServer

    --- a/Misc/NEWS +++ b/Misc/NEWS @@ -27,6 +27,8 @@ Core and Builtins Library ------- +- Issue #22165: SimpleHTTPRequestHandler now supports undecodable file names. +