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
bpo-38216, bpo-36274: Allow subclasses to separately override validation and encoding behavior #16448
bpo-38216, bpo-36274: Allow subclasses to separately override validation and encoding behavior #16448
Conversation
…alidation, test demonstrating override encoding, and a test to capture expectation of the interface for the URL.
This makes overriding just that simpler. Also, don't use the := operator to make backporting easier.
…ally simplifying the behavior. Drop the guarantee that all processing happens in _prepare_path.
Thanks @jaraco for the PR |
GH-16460 is a backport of this pull request to the 3.8 branch. |
Sorry, @jaraco, I could not cleanly backport this to |
Sorry @jaraco, I had trouble checking out the |
GH-16461 is a backport of this pull request to the 3.7 branch. |
GH-16462 is a backport of this pull request to the 3.6 branch. |
…alidation and encoding behavior (GH-16448) (GH-16461) * bpo-38216: Allow bypassing input validation * bpo-36274: Also allow the URL encoding to be overridden. * bpo-38216, bpo-36274: Add tests demonstrating a hook for overriding validation, test demonstrating override encoding, and a test to capture expectation of the interface for the URL. * Call with skip_host to avoid tripping on the host checking in the URL. * Remove obsolete comment. * Make _prepare_path_encoding its own attr. This makes overriding just that simpler. Also, don't use the := operator to make backporting easier. * Add a news entry. * _prepare_path_encoding -> _encode_prepared_path() * Once again separate the path validation and request encoding, drastically simplifying the behavior. Drop the guarantee that all processing happens in _prepare_path.. (cherry picked from commit 7774d78) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
…ion and encoding behavior (GH-16448) * bpo-38216: Allow bypassing input validation * bpo-36274: Also allow the URL encoding to be overridden. * bpo-38216, bpo-36274: Add tests demonstrating a hook for overriding validation, test demonstrating override encoding, and a test to capture expectation of the interface for the URL. * Call with skip_host to avoid tripping on the host checking in the URL. * Remove obsolete comment. * Make _prepare_path_encoding its own attr. This makes overriding just that simpler. Also, don't use the := operator to make backporting easier. * Add a news entry. * _prepare_path_encoding -> _encode_prepared_path() * Once again separate the path validation and request encoding, drastically simplifying the behavior. Drop the guarantee that all processing happens in _prepare_path. (cherry picked from commit 7774d78) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
GH-16475 is a backport of this pull request to the 3.5 branch. |
GH-16476 is a backport of this pull request to the 2.7 branch. |
…ion and encoding behavior (pythonGH-16448) * bpo-38216: Allow bypassing input validation * bpo-36274: Also allow the URL encoding to be overridden. * bpo-38216, bpo-36274: Add tests demonstrating a hook for overriding validation, test demonstrating override encoding, and a test to capture expectation of the interface for the URL. * Call with skip_host to avoid tripping on the host checking in the URL. * Remove obsolete comment. * Make _prepare_path_encoding its own attr. This makes overriding just that simpler. Also, don't use the := operator to make backporting easier. * Add a news entry. * _prepare_path_encoding -> _encode_prepared_path() * Once again separate the path validation and request encoding, drastically simplifying the behavior. Drop the guarantee that all processing happens in _prepare_path.
This PR builds on and supersedes #16321 as an alternative approach for consideration.
https://bugs.python.org/issue38216