Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up[2.7] bpo-38216, bpo-36274: Allow subclasses to separately override validation and encoding behavior (GH-16448) #16476
Conversation
This comment has been minimized.
This comment has been minimized.
Backporting this change, I observe a couple of things:
|
…alidation 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>
This comment has been minimized.
This comment has been minimized.
As a reminder, this PR is for your consideration. The reported failure cases for bpo-38216 already have workarounds implemented, so there are no known pressing needs for this corrective bugfix. Accepting this change will, however, provide a consistent workaround that applies to other (not-yet-identified) use-cases across all (affected) Python versions, so it seems worthwhile to me. |
This comment has been minimized.
This comment has been minimized.
Since 2.7 wasn't ever released with the fix for bpo-38216, I'm going to say we should take this just in case. I'm going to edit your PR to remove the usage of |
jaraco commentedSep 29, 2019
•
edited by bedevere-bot
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
https://bugs.python.org/issue38216