From 92d10d2bb285cb0d57daddcdb3e98878185e87e6 Mon Sep 17 00:00:00 2001 From: OfficiallySomeGuy <33982095+OfficiallySomeGuy@users.noreply.github.com> Date: Thu, 27 Mar 2025 16:54:05 -0700 Subject: [PATCH] Remove logic stripping URL components not suffixed with / Discussed further in PR --- Lib/urllib/parse.py | 4 ---- 1 file changed, 4 deletions(-) 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] == '/':