Skip to content

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

Open
Mr-Sunglasses wants to merge 2 commits into
python:mainfrom
Mr-Sunglasses:fix/130578
Open

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

Conversation

@Mr-Sunglasses
Copy link
Copy Markdown
Contributor

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

@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
Copy link
Copy Markdown
Member

vadmium commented May 14, 2025

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

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

5 participants