Title: Inconsistent handling of special characters in DecodedURL · Issue #164 · python-hyper/hyperlink · GitHub
Open Graph Title: Inconsistent handling of special characters in DecodedURL · Issue #164 · python-hyper/hyperlink
X Title: Inconsistent handling of special characters in DecodedURL · Issue #164 · python-hyper/hyperlink
Description: Working with DecodedURL objects is problematic if the URL contains special characters. Because attributes like url.path do not return the raw value, you get some weird behaviour using replace: >>> from hyperlink import parse >>> url = pa...
Open Graph Description: Working with DecodedURL objects is problematic if the URL contains special characters. Because attributes like url.path do not return the raw value, you get some weird behaviour using replace: >>> ...
X Description: Working with DecodedURL objects is problematic if the URL contains special characters. Because attributes like url.path do not return the raw value, you get some weird behaviour using replace: >...
Opengraph URL: https://github.com/python-hyper/hyperlink/issues/164
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inconsistent handling of special characters in DecodedURL","articleBody":"Working with DecodedURL objects is problematic if the URL contains special characters. Because attributes like `url.path` do not return the raw value, you get some weird behaviour using `replace`:\r\n\r\n```py\r\n>>> from hyperlink import parse\r\n>>> url = parse('https://www.example.com/game/Saints-Row:-The-Third')\r\n>>> url == url.replace()\r\nTrue\r\n>>> url == url.replace(host=url.host)\r\nTrue\r\n>>> url == url.replace(path=url.path)\r\nFalse\r\n>>> url.path == url.replace(path=url.path).path\r\nTrue\r\n```\r\n\r\nIn the docs there's this line about encoding:\r\n\r\n> DecodedURL automatically handles encoding and decoding all its components, such that all inputs and outputs are in a maximally-decoded state. \r\n\r\nThis does not seem to be the case as if DecodedURL was doing this, these equalities would always be True, unless I'm misunderstanding something (entirely possible 🙃).\r\n\r\nWorking with `parse('…', decoded=False)` instead seems to solve this problem, although I'm not sure if that's the \"right\" solution to this.\r\n\r\nThis situation was very confusing to me, especially since `normalize()` didn't seem to have any effect at all (although reading the docs for it, I'm not actually sure if it should or not).\r\n\r\nI'm unsure if this behaviour is a bug, or it's just me not using the library the right way. Either way, I'd appreciate your input!","author":{"url":"https://github.com/deains","@type":"Person","name":"deains"},"datePublished":"2021-05-04T12:53:09Z","url":"https://github.com/python-hyper/hyperlink/issues/164"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:570218c9-5434-0811-7824-48234df5dc1c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A304:770A3:D1E72F:11BC8B1:6B06E7AB |
| html-safe-nonce | ee2984f124000ff34cd66ef32f6874b9281bdef7bcbc607e3a63924a4722df9c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMzA0Ojc3MEEzOkQxRTcyRjoxMUJDOEIxOjZCMDZFN0FCIiwidmlzaXRvcl9pZCI6Ijg3MjM1MDkxMTM0NjA1MjI3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 2c5c3012d739bc5ba2bd4c8f2b886fe4d55d7e9fd0bbdd3ef6c5ea8a22384cb3 |
| hovercard-subject-tag | issue:875432043 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-hyper/hyperlink/164/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ec18ec43faa06f60c404fcb647e8d41015b5a342055f333f7e7589323bd6d67c/python-hyper/hyperlink/issues/164 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ec18ec43faa06f60c404fcb647e8d41015b5a342055f333f7e7589323bd6d67c/python-hyper/hyperlink/issues/164 |
| og:image:alt | Working with DecodedURL objects is problematic if the URL contains special characters. Because attributes like url.path do not return the raw value, you get some weird behaviour using replace: >>> ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | deains |
| hostname | github.com |
| expected-hostname | github.com |
| None | 351ea5ca38a5758919d44ee52c70fe9003c0c2dfa20f04effd7fac0c5330c16b |
| turbo-cache-control | no-preview |
| go-import | github.com/python-hyper/hyperlink git https://github.com/python-hyper/hyperlink.git |
| octolytics-dimension-user_id | 13035907 |
| octolytics-dimension-user_login | python-hyper |
| octolytics-dimension-repository_id | 82321340 |
| octolytics-dimension-repository_nwo | python-hyper/hyperlink |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 82321340 |
| octolytics-dimension-repository_network_root_nwo | python-hyper/hyperlink |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | af8913cd0f2f77c41796be449ac66a9108825abc |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width