python / python/cpython

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

未關閉
#146,014 10 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

stdlib type-bug
主要語言
Python
星號
77.2k
分支
35.9k
PR 合併指標
PR 指標待擷取

描述

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

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先定位 urllib.parse.urlparse 和 urlsplit 入口點,並重現 issue 中的 SIP URI 範例。檢查針對特定 scheme 的 URL 的現有解析行為和測試,然後確保兩個函式都將 SIP authority 視為 netloc,並保留預期結果中顯示的 parameters 和 query。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
networking
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
描述清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。