urllib.request.urlopen hangs for multiple minutes with timeout=30 and works with timeout=1
未關閉
還沒有人認領這個 Issue。
stdlib
type-bug
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 36k
- PR 合併指標
- PR 指標待擷取
描述
Bug report
Bug description:
import urllib.request
urllib.request.urlopen(urllib.request.Request("https://pypi.org/pypi/MozPhab/json"), timeout=30)
Somehow this hangs, and Control+C doesn't stop it. The same URL loads instantly on Firefox and Node.js. Any help to investigate this further will be appreciated. (Could be related to #95838, except I don't have any VPN on this machine.)
Coming from https://bugzilla.mozilla.org/show_bug.cgi?id=1919884.
CPython versions tested on:
3.12
Operating systems tested on:
Windows
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
首先,在使用 Python 3.12 的 Windows 上,使用針對 pypi.org URL 的 Request 重現 urllib.request.urlopen 呼叫,並比較 timeout=30 與 timeout=1。閱讀相關 issue #95838,調查要求在哪個環節停止回應;當長時間掛起得到解釋,且回報的行為已修正或明確縮小範圍時,即視為完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- networking
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 35/100