bpo-35640: Allow passing PathLike arguments to SimpleHTTPRequestHandler (GH-11398)

This commit is contained in:
Géry Ogam 2019-09-11 15:03:46 +02:00 committed by Zachary Ware
parent e1d455f3a3
commit 781266ebb6
4 changed files with 80 additions and 24 deletions

View file

@ -642,7 +642,7 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
def __init__(self, *args, directory=None, **kwargs):
if directory is None:
directory = os.getcwd()
self.directory = directory
self.directory = os.fspath(directory)
super().__init__(*args, **kwargs)
def do_GET(self):