-
Notifications
You must be signed in to change notification settings - Fork 315
revert url credential encoding (to be reintroduced as an option in future) #1882
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
Conversation
|
@Viicos I'd love your opinions on my points of discussion above. |
CodSpeed Performance ReportMerging #1882 will not alter performanceComparing Summary
|
I've read through RFC3986 in more detail:
We might raise an error, but not until V3. And yes for the url validation the parsing should just assume components were properly encoded first, and it will do best effort to provide meaningful validation errors (but at least should error on every invalid case). |
I wouldn't think we need to wait until v3 to raise errors from The point is that in the So calling |
|
I have now made this PR disable the behaviour again while we figure out correct semantics for pydantic 2.13. |
…ture) (pydantic/pydantic-core#1882) Original-commit-link: pydantic/pydantic-core@4d23017
Change Summary
This carries out the partial revert described in #1829 (comment), moving
encode_credentialsbehaviour to a keyword argument, defaultingFalsefor backwards compatbility with pre-2.12.1 behaviour.EDIT: while implementing this, the points of discussion below made it clear the semantics need further work. Here we now fully revert the URL credential encoding in Pydantic 2.12. We plan to introduce this option in Pydantic 2.13 when we have had time to design it properly.
Note: while implementing this (and the test) I observed how broken the URL parsing can be when encoding is not done:
percent_encode: booland affect all components? I can rework this PR and extend tests if so.buildmethods if components are not properly escaped andpercent_encodeisFalse?percent_encodeoption because the component boundaries are not known.Related issue number
Closes pydantic/pydantic#12457
Closes pydantic/pydantic#12434
Checklist
pydantic-core(except for expected changes)