python / python/cpython

3.14.0a1 urljoin regression wrt //

Open
#125,974 12 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

3.14 stdlib type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

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 fc897fcc01964649f023e0baa4c95d142e4e8a10 https://github.com/python/cpython/pull/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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with urllib.parse.urljoin and inspect the behavior change introduced by fc897fcc01964649f023e0baa4c95d142e4e8a10. Reproduce the lxml-style example on Python 3.14 and confirm that the completed fix restores file:///foo/bar for urljoin('file:', '/foo/bar') without regressing the reported change.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.