-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bring code borrowed from http.server
in sync with upstream
#4379
base: master
Are you sure you want to change the base?
Conversation
2b80fce
to
208d43b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you get rid off the unused imports like posixpath and urllib to run pycodestyle test without any problem?
|
||
if self.path == '/': | ||
self.path = "index.html" | ||
|
||
# Check that the given path is a file. | ||
# The base directory is set to www_root. | ||
if not os.path.exists(self.translate_path(self.path)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You already deleted this translate_path fuction so I think you would have modified this if state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deleted the re-implementation of the translate_path function, this calls SimpleHTTPRequestHandler.translate_path() - translating the path with the root set to www_root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh OK, I didn't noticed that.
Linter passes as of latest commit. |
Remove translate_path() to rely on http.server's implementation, and fix handling of leading slashes.