LocalWebserver stuck if some other application is running on windows
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
エントリポイント gauth.LocalWebserverAuth() から開始し、ポート 8080 をバインドして OAuth リダイレクトを構築する方法を追跡します。8080 が使用中の場合の動作を確認し、その後、フォールバックポートがリダイレクトに反映され、認可後にコマンドが完了することを確認します。
索引モデルが issue の本文から書いたものです。
説明
Hi,
When something is already running on port 8080, calling:
gauth.LocalWebserverAuth()
successfully opens the browser for OAuth, but after granting access, the redirect to http://localhost:8080/?code=... fails with ERR_CONNECTION_REFUSED.
The command line then just waits indefinitely for the code, because the local server never started on that port.
This happens because LocalWebserverAuth tries to bind to 8080 without checking if it’s free.
Proposed fix:
Check if the port is available before binding, and try alternatives in a small range (e.g., 8080–8085) before raising an error. Example using portpicker:
import portpicker
candidate_ports = [8080] + list(range(8081, 8086))
port_number = None
for p in candidate_ports:
if portpicker.is_port_free(p):
port_number = p
break
if port_number is None:
raise RuntimeError("No free port in range 8080–8085")
print(f"Using port {port_number}")
If a non-default port is selected, it would also need to be reflected in the OAuth URL so the redirect URI matches.
Users can pre-register multiple redirect URIs in Google Cloud Console to cover the fallback ports.
- 主要言語
- Python
- スター
- 670
- フォーク
- 75
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
iterative/PyDrive2 のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 30/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
maintenance priority-p2
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
iterative/PyDrive2 の issue をすべて見る
似ている issue
-
area: harness bug status: needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Human-Agent-Society/reef#625 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
learningequality/kolibri#15351 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
Name consistency オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
eellak/triplestore#65 · コメント 1 件 ·