python / python/cpython

Fix SIP URI support for `urllib.parse.url{parse,split}` (RFC 3261)

Open
#146,014 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Bug report

Bug description:

urllib.parse currently supports the SIP URI scheme. However, it mislabels the netloc as the path.

>>> import urllib.parse
>>> urllib.parse.urlparse('sip:user:password@host:port;uri-parameters?headers')
ParseResult(scheme='sip', netloc='', path='user:password@host:port', params='uri-parameters', query='headers', fragment='')

RFC 3261 defines the sip URI without slashes, like so:

sip:user:password@host:port;uri-parameters?headers

The correct ParseResult would be:

>>> urllib.parse.urlparse('sip:user:password@host:port;uri-parameters?headers')
ParseResult(scheme='sip', netloc='user:password@host:port', path='', params='uri-parameters', query='headers', fragment='')
CPython versions tested on:

3.14

Operating systems tested on:

macOS

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 by locating the urllib.parse.urlparse and urlsplit entry points and reproduce the SIP URI example from the issue. Review the existing parsing behavior and tests for scheme-specific URLs, then ensure both functions treat the SIP authority as netloc and preserve the parameters and query shown in the expected result.

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.