Skip to content
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

3.14.0a1 urljoin regression wrt // #125974

Open
hroncok opened this issue Oct 25, 2024 · 4 comments
Open

3.14.0a1 urljoin regression wrt // #125974

hroncok opened this issue Oct 25, 2024 · 4 comments
Labels
3.14 new features, bugs and security fixes type-bug An unexpected behavior, bug, or error

Comments

@hroncok
Copy link
Contributor

hroncok commented Oct 25, 2024

Bug report

Bug description:

The tests of lxml do (simplified):

from urllib.parse import urljoin
urljoin('file:', '/foo/bar')
  • On Python 3.13.0 and earlier, the result of the urljoin call is file:///foo/bar.
  • On Python 3.14.0a1, the result of the urljoin call is file:/foo/bar.

This change of behavior was introduced in fc897fc #123273 cc @serhiy-storchaka

The NEWS entry in that change does not seem to indicate this change was intentional.

CPython versions tested on:

3.14, CPython main branch

Operating systems tested on:

Linux

@hroncok hroncok added the type-bug An unexpected behavior, bug, or error label Oct 25, 2024
@hugovk hugovk added the 3.14 new features, bugs and security fixes label Oct 25, 2024
@ZeroIntensity
Copy link
Member

Duplicate of #125926

@ZeroIntensity ZeroIntensity marked this as a duplicate of #125926 Oct 25, 2024
@ZeroIntensity ZeroIntensity closed this as not planned Won't fix, can't repro, duplicate, stale Oct 25, 2024
@hroncok
Copy link
Contributor Author

hroncok commented Oct 25, 2024

That seemed like a different problem to me, but perhaps the cause is the same, yes.

@serhiy-storchaka
Copy link
Member

This is not a duplicate of #125926.

But file:///foo/bar and file:/foo/bar are equivalent URIs. And we can argue that since file: and /foo/bar have undefined authority, the result should have undefined authority as well. This is a result of the algorithm in RFC 3986, Section 5.2.2, although it need an absolute base URI.

@ZeroIntensity ZeroIntensity marked this as not a duplicate of #125926 Oct 25, 2024
@ZeroIntensity
Copy link
Member

I marked this as duplicate because it seemed like there was some underlying issue introduced into urljoin. I was assuming they will both be fixed by the same PR, but I guess not, sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.14 new features, bugs and security fixes type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants