Skip to content

Conversation

Mr-Sunglasses
Copy link
Contributor

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

@StanFromIreland
Copy link
Member

Requesting @gvanrossum since you originally added this.

@gvanrossum
Copy link
Member

Sorry, I no longer do such code reviews.

@vadmium
Copy link
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.

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

4 participants