python / python/cpython

Add test coverage for parse_qsl/parse_qs strict_parsing on malformed query fields

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

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

tests type-feature
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

urllib.parse.parse_qsl() and parse_qs() accept a strict_parsing keyword that, when True, raises ValueError on a malformed query field — one without a = separator, e.g. "a=1&b&c=3". This error branch is currently not exercised by Lib/test/test_urlparse.py: the existing parse_qsl/parse_qs tests only cover well-formed inputs and the default lenient behavior, so a regression that silently dropped the strict_parsing check would not be caught. It would be good to add a small test covering the strict_parsing=True branch for both functions on str and bytes inputs, alongside a well-formed control. Addressed by PR #154207.

Linked PRs
  • gh-154207

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

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

はじめの一歩

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

調査の方向性

Lib/test/test_urlparse.py から始めて、既存の parse_qsl と parse_qs のテストを、str と bytes のケースを含めて確認します。PR #154207 が不正なクエリフィールドと正しい形式のクエリフィールドに対する strict_parsing=True を扱っていることを確認し、関連する urlparse テストスイートを使用してカバレッジを検証します。

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

評価

技術スタック
python
領域
testing-qa
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
25/100

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

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