diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index 9d51f4c6812b57..d5a8cf7a6aee27 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -611,10 +611,6 @@ def urljoin(base, url, allow_fragments=True): query, fragment)) base_parts = bpath.split('/') - if base_parts[-1] != '': - # the last item is not a directory, so will not be taken into account - # in resolving the relative path - del base_parts[-1] # for rfc3986, ignore all base path should the first character be root. if path[:1] == '/':