Fix SIP URI support for `urllib.parse.url{parse,split}` (RFC 3261)
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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