Bug report
Bug description:
Documented behaviour: urljoin's docstring promises: "Join a base URL and a possibly relative URL to form an absolute interpretation of the latter." The module documentation states: "RFC 3986 is considered the current standard and any future changes to urllib.parse module should conform with it." RFC 3986 sections 5.2.3–5.2.4 specify path merging and dot-segment removal; empty interior segments are not dot segments.
Expected: https://example.com/a/b//c
Actual: https://example.com/a/b/c
import re
import urllib.parse
base, r = "https://example.com/a/", "b//c"
if not re.fullmatch(r"[A-Za-z]+(?:/+[A-Za-z]+)*", r):
print("REFUTATION REJECTED:", "input is outside the claimed domain")
else:
actual = urllib.parse.urljoin(base, r)
# RFC 3986: merge with the base directory; no dot segments to remove.
expected = base + r
if actual != expected:
print("REFUTATION CONFIRMED:", repr(r), repr(actual), repr(expected))
else:
print("REFUTATION REJECTED:", "actual equals the RFC expectation")
Output on Python 3.14.6 (Windows-11-10.0.26220-SP0), standard library urllib.parse:
REFUTATION CONFIRMED: 'b//c' 'https://example.com/a/b/c' 'https://example.com/a/b//c'
This report was found and written by an automated property-testing tool I run (bugforge). The reproducer above was executed and its output is pasted unedited; no person reviewed the report before it was filed. The search script is in https://github.com/augusto-rehfeldt/bugforge-results/tree/main/urllib.parse-20261003-015128-c3
CPython versions tested on:
3.14
Operating systems tested on:
Windows
Bug report
Bug description:
Documented behaviour: urljoin's docstring promises: "Join a base URL and a possibly relative URL to form an absolute interpretation of the latter." The module documentation states: "RFC 3986 is considered the current standard and any future changes to urllib.parse module should conform with it." RFC 3986 sections 5.2.3–5.2.4 specify path merging and dot-segment removal; empty interior segments are not dot segments.
Expected: https://example.com/a/b//c
Actual: https://example.com/a/b/c
Output on Python 3.14.6 (Windows-11-10.0.26220-SP0), standard library
urllib.parse:This report was found and written by an automated property-testing tool I run (bugforge). The reproducer above was executed and its output is pasted unedited; no person reviewed the report before it was filed. The search script is in https://github.com/augusto-rehfeldt/bugforge-results/tree/main/urllib.parse-20261003-015128-c3
CPython versions tested on:
3.14
Operating systems tested on:
Windows