Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.2k
Addencoded_string()
method to the URL types#11580
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Addencoded_string()
method to the URL types#11580
Uh oh!
There was an error while loading.Please reload this page.
Conversation
codspeed-hqbot commentedMar 18, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
CodSpeed Performance ReportMerging#11580 willnot alter performanceComparing Summary
|
github-actionsbot commentedMar 19, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Coverage reportClick to see where and how coverage changed
This report was generated bypython-coverage-comment-action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks for the contribution. Theencoded()
method needs to be added on_BaseMultiHostUrl
as well.
tests/test_networks.py Outdated
@@ -330,6 +330,7 @@ class Model(BaseModel): | |||
# https://www.xudongz.com/blog/2017/idn-phishing/ accepted but converted | |||
('https://www.аррӏе.com/', 'https://www.xn--80ak6aa92e.com/'), | |||
('https://exampl£e.org', 'https://xn--example-gia.org/'), | |||
('http://puny£code.com', 'http://xn--punycode-eja.com/'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
('http://puny£code.com', 'http://xn--punycode-eja.com/'), |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
@Viicos can u take a look on the new _BaseMultiHostUrl test that I have added |
encoded_string()
method to the URL typesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks for the contribution
87cb27f
intopydantic:mainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Change Summary
This PR introduces a new
encoded
property to theUrl
class inpydantic/networks.py
. Theencoded
property returns the punycode-encoded host version of the URL as a string. Additionally, a new test case has been added totests/test_networks.py
to verify the functionality of theencoded
property.Related issue number
fixes#11551
Checklist
The pull request title is a good summary of the changes - it will be used in the changelog
Unit tests for the changes exist
Tests pass on CI
Documentation reflects the changes where applicable
My PR is ready to review,please add a comment including the phrase "please review" to assign reviewers