Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove custom implementation of percent_encode #142

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pquentin
Copy link
Member

@pquentin pquentin commented Jan 5, 2024

We can rely on the standard library starting from Python 3.7. See https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote.

We can rely on the standard library starting from Python 3.7.
# within the 'ALWAYS_SAFE' list. The character was added in Python 3.7
safe = "".join(_QUOTE_ALWAYS_SAFE.union(set(safe)))
# This function used to add `~` to unreserverd characters, but this was fixed in Python 3.7.
# Keeping the function here as it is part of the public API.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the function be deprecated, though? My guess is that we'd want to steer people away from using a custom function now that it is simply a wrapper.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be deprecated, but is currently used in elasticsearch-py. I'll look into doing it, thanks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently blocked by elastic/elasticsearch-py#2268.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pquentin
Copy link
Member Author

Sorry, this is not done yet. I need to add a DeprecationWarning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants