Skip to content

gh-130578: clarify urllib.parse.quote parameter defaults behavior#130598

Merged
orsenthil merged 2 commits into
python:mainfrom
Mr-Sunglasses:fix/130578
Jul 9, 2026
Merged

gh-130578: clarify urllib.parse.quote parameter defaults behavior#130598
orsenthil merged 2 commits into
python:mainfrom
Mr-Sunglasses:fix/130578

Conversation

@Mr-Sunglasses

@Mr-Sunglasses Mr-Sunglasses commented Feb 26, 2025

Copy link
Copy Markdown
Contributor

@StanFromIreland

Copy link
Copy Markdown
Member

Requesting @gvanrossum since you originally added this.

@gvanrossum

Copy link
Copy Markdown
Member

Sorry, I no longer do such code reviews.

@vadmium

vadmium commented May 14, 2025

Copy link
Copy Markdown
Member

This looks like an improvement to me, although it would be more complete to explicitly allow passing None even when string is a byte string.

FWIW I would write something like

If string is a str object, encoding and errors specify how to deal with non-ASCII characters. If encoding is None, the 'utf-8' encoding is used as default. If errors is None, the 'strict' error handler is used as default. All other encoding and error values accepted by str.encode are also allowed.

If string is a bytes object, encoding and errors must be None, or a TypeError is raised.

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 22, 2026
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #32799520 | 📁 Comparing 40a8925 against main (65f9932)

  🔍 Preview build  

1 file changed
± library/urllib.parse.html

@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label May 23, 2026
@orsenthil orsenthil added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jul 9, 2026
@orsenthil orsenthil enabled auto-merge (squash) July 9, 2026 05:11
@orsenthil orsenthil merged commit bc9bb73 into python:main Jul 9, 2026
40 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Jul 9, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @Mr-Sunglasses for the PR, and @orsenthil for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jul 9, 2026

Copy link
Copy Markdown

GH-153383 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 9, 2026
@bedevere-app

bedevere-app Bot commented Jul 9, 2026

Copy link
Copy Markdown

GH-153384 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jul 9, 2026
@bedevere-app

bedevere-app Bot commented Jul 9, 2026

Copy link
Copy Markdown

GH-153385 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jul 9, 2026
orsenthil pushed a commit that referenced this pull request Jul 9, 2026
…ior (GH-130598) (#153385)

gh-130578: clarify urllib.parse.quote parameter defaults behavior (GH-130598)
(cherry picked from commit bc9bb73)

Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
orsenthil pushed a commit that referenced this pull request Jul 9, 2026
…ior (GH-130598) (#153383)

gh-130578: clarify urllib.parse.quote parameter defaults behavior (GH-130598)
(cherry picked from commit bc9bb73)

Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
orsenthil pushed a commit that referenced this pull request Jul 9, 2026
…ior (GH-130598) (#153384)

gh-130578: clarify urllib.parse.quote parameter defaults behavior (GH-130598)
(cherry picked from commit bc9bb73)

Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

urllib.parse.quote is not consistent about encoding and errors defaults

6 participants