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

refactor(URLRequired): Deprecate URLRequired exception with warning #6881

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jakobheine
Copy link

requests.URLRequired has been dead code since ab27027 (2012) and is never raised. This commit adds a DeprecationWarning to notify users that it will be removed in a future version. Invalid URLs instead raise MissingSchema, InvalidSchema, or InvalidURL.

`requests.URLRequired` has been dead code since ab27027 (2012) and is
never raised. This commit adds a `DeprecationWarning` to notify users
that it will be removed in a future version. Invalid URLs instead
raise `MissingSchema`, `InvalidSchema`, or `InvalidURL`.

Signed-off-by: jakobheine <[email protected]>
@The-Compiler
Copy link

Note this only emits a warning when the exception is raised (which would only ever be done in requests code), not when it is caught.

A module-level __getattr__ would instead emit such a warning whenever it is accessed, see e.g. the removed code in pytest-dev/pytest@477959e for some inspiration.

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.

2 participants