python / python/cpython

urllib.request.urlopen hangs for multiple minutes with timeout=30 and works with timeout=1

オープン
#125,049 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. 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

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。