python / python/cpython

URL Parse Split incorreclty interpret proxy pw, which include '?'

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

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

stdlib
主要言語
Python
スター
77.2k
フォーク
36k
平均マージ
1日 9時間
マージ済み PR(30日)
558

説明

Hi,

I have exported the env var for http proxy, where the Username and password is included in the URL.
The password of the user includes an '?', which is the reason, why the URL string is not correctly processed.

The URL
http_proxy='http://<username>:<pass_with_?>@<server>:<port>'

When the method splits:
https://github.com/python/cpython/blob/53d9cd95cd91f1a291a3923acb95e0e86942291a/Lib/urllib/parse.py#L477

It splits at the ? of the password.

Therefore resulting into

 File "/usr/lib/python3/dist-packages/httplib2/__init__.py", line 950, in proxy_info_from_url
    port = int(port)
ValueError: invalid literal for int() with base 10: 'p'

if the URL would be:

http://user:p?assword@server:port

Regards
Nam

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Issue でリンクされている URL 分割コードがある Lib/urllib/parse.py から始め、http://user:p?assword@server:port のパースを再現してください。プロキシ認証情報内の疑問符に対する想定どおりの処理を確認し、その後、この例でパスワードの一部が別の URL コンポーネントとして扱われなくなっていることを検証してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
networking
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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