René's URL Explorer Experiment


Title: Recommended practice for adding reserved characters? · Issue #44 · python-hyper/hyperlink · GitHub

Open Graph Title: Recommended practice for adding reserved characters? · Issue #44 · python-hyper/hyperlink

X Title: Recommended practice for adding reserved characters? · Issue #44 · python-hyper/hyperlink

Description: Per @markrwilliams comment here and a few others dotted around, we're facing a design gap in hyperlink's APIs. To paraphrase: url = URL() url.add(u'param', u'#value').to_text() Yields: ValueError: one or more reserved delimiters &# prese...

Open Graph Description: Per @markrwilliams comment here and a few others dotted around, we're facing a design gap in hyperlink's APIs. To paraphrase: url = URL() url.add(u'param', u'#value').to_text() Yields: ValueError: ...

X Description: Per @markrwilliams comment here and a few others dotted around, we're facing a design gap in hyperlink's APIs. To paraphrase: url = URL() url.add(u'param', u'#value').to_tex...

Opengraph URL: https://github.com/python-hyper/hyperlink/issues/44

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Recommended practice for adding reserved characters?","articleBody":"Per @markrwilliams comment [here](https://github.com/python-hyper/hyperlink/issues/6#issuecomment-338984058) and a few others dotted around, we're facing a design gap in hyperlink's APIs. \r\n\r\nTo paraphrase:\r\n```\r\nurl = URL()\r\nurl.add(u'param', u'#value').to_text()\r\n```\r\nYields:\r\n```\r\nValueError: one or more reserved delimiters &# present in query parameter value: u'#value'\r\n```\r\n\r\nThis is due to a subtle shift in hyperlink's design compared to `twisted.python.url`. `t.p.url` would allow any string value in, whereas hyperlink prefers to store the \"minimally-encoded\" version. This is why a `ValueError` is raised from the code above.\r\n\r\nTechnically, this can be solved by making the code `url.add(u'param', _encode_query_part(u'#value'))`. But hyperlink's primary goal is to handle encoding/decoding, does it really make sense to push that back on the user?\r\n\r\nOne solution Mark and I discussed would be to switch to decoding every value passed in. But what if someone were to pass in `u'%23%'` and actually intend for that to be their decoded value? And the API would be further complicated by the fact that the underlying decoding is generally unknown. UTF8, Latin-1, and plain old binary are all valid in percent-encoded URL parts. Autodecoding UTF8 might have better usability most of the time, but much like relying on Python 2's implicit encoding/decoding, the safety of the explicit `_encode_*_part()` is probably preferable.\r\n\r\nIt might occur to one that this entire problem bears some resemblance to the `bytes`/`unicode` split, as `URL` has `URL.to_uri()` and `URL.to_iri()`. There is some truth to this, but both IRIs and URIs are both URLs. Having two types imposes a sort of artificial split I'd like to avoid if possible, but we also don't have a good way to represent an already decoded IRI. This was causing an issue with double decoding on multiple `.to_iri()` calls (see #16). \r\n\r\nRight now my best idea is to enable that technical solution above by exposing the various encoding and decoding functions as public APIs, since those may prove useful utilities for other contexts anyways. I'm sure there are better ideas, too, so I'm going to leave this issue open as a place for discussion on handling this quandary.","author":{"url":"https://github.com/mahmoud","@type":"Person","name":"mahmoud"},"datePublished":"2017-10-26T17:45:40Z","url":"https://github.com/python-hyper/hyperlink/issues/44"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:feb9d46c-2272-bd31-5ce1-11b49496dac1
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAB88:DD526:EF00E4:146AECD:6B06F134
html-safe-nonce1ff484517b6f4e6ff817cb7c10341e832c124626af646f61370835d90fb89f37
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjg4OkRENTI2OkVGMDBFNDoxNDZBRUNEOjZCMDZGMTM0IiwidmlzaXRvcl9pZCI6Ijc1MjIwNjg2ODQ0ODg1MDM2MDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaced19f88b7077b77edb252e61d2e14dc39dc72f377eb52f07ed42e22dd2b4ef0f
hovercard-subject-tagissue:268850644
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-hyper/hyperlink/44/issue_layout
twitter:imagehttps://opengraph.githubassets.com/afd8650e398c0c65ce2c6ba6b8606bc972eb3e8176c06ff04677a44fe5a2f85a/python-hyper/hyperlink/issues/44
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/afd8650e398c0c65ce2c6ba6b8606bc972eb3e8176c06ff04677a44fe5a2f85a/python-hyper/hyperlink/issues/44
og:image:altPer @markrwilliams comment here and a few others dotted around, we're facing a design gap in hyperlink's APIs. To paraphrase: url = URL() url.add(u'param', u'#value').to_text() Yields: ValueError: ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemahmoud
hostnamegithub.com
expected-hostnamegithub.com
None351ea5ca38a5758919d44ee52c70fe9003c0c2dfa20f04effd7fac0c5330c16b
turbo-cache-controlno-preview
go-importgithub.com/python-hyper/hyperlink git https://github.com/python-hyper/hyperlink.git
octolytics-dimension-user_id13035907
octolytics-dimension-user_loginpython-hyper
octolytics-dimension-repository_id82321340
octolytics-dimension-repository_nwopython-hyper/hyperlink
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id82321340
octolytics-dimension-repository_network_root_nwopython-hyper/hyperlink
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release891bde3f438884e9c6c7ccd826f33805910a978b
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python-hyper/hyperlink/issues/44#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-hyper%2Fhyperlink%2Fissues%2F44
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-hyper%2Fhyperlink%2Fissues%2F44
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python-hyper%2Fhyperlink
Reloadhttps://github.com/python-hyper/hyperlink/issues/44
Reloadhttps://github.com/python-hyper/hyperlink/issues/44
Reloadhttps://github.com/python-hyper/hyperlink/issues/44
python-hyperhttps://github.com/python-hyper
hyperlinkhttps://github.com/python-hyper/hyperlink
Codehttps://github.com/python-hyper/hyperlink
Issues37 (37)https://github.com/python-hyper/hyperlink/issues
Pull requests21 (21)https://github.com/python-hyper/hyperlink/pulls
Actionshttps://github.com/python-hyper/hyperlink/actions
Projectshttps://github.com/python-hyper/hyperlink/projects
Security and qualityhttps://github.com/python-hyper/hyperlink/security
Insightshttps://github.com/python-hyper/hyperlink/insights
https://github.com/python-hyper/hyperlink
New issuehttps://github.com/login?return_to=https://github.com/python-hyper/hyperlink/issues/44
New issuehttps://github.com/login?return_to=https://github.com/python-hyper/hyperlink/issues/44
Recommended practice for adding reserved characters?https://github.com/python-hyper/hyperlink/issues/44#top
https://github.com/mahmoud
mahmoudhttps://github.com/mahmoud
on Oct 26, 2017https://github.com/python-hyper/hyperlink/issues/44#issue-268850644
@markrwilliamshttps://github.com/markrwilliams
herehttps://github.com/python-hyper/hyperlink/issues/6#issuecomment-338984058
#16https://github.com/python-hyper/hyperlink/issues/16
https://github.com/glyph
glyphhttps://github.com/glyph
on Nov 12, 2017https://github.com/python-hyper/hyperlink/issues/44#issuecomment-343725167
https://github.com/mahmoud
mahmoudhttps://github.com/mahmoud
on Nov 13, 2017https://github.com/python-hyper/hyperlink/issues/44#issuecomment-343788364
https://github.com/glyph
glyphhttps://github.com/glyph
on Nov 13, 2017https://github.com/python-hyper/hyperlink/issues/44#issuecomment-344019327
https://github.com/mahmoud
mahmoudhttps://github.com/mahmoud
on Nov 13, 2017https://github.com/python-hyper/hyperlink/issues/44#issuecomment-344021294
thishttps://github.com/python-hyper/hyperlink/blob/2bc8dff95e8b1394c35bde1b5d40ee78e42c92df/hyperlink/_url.py#L140-L296
https://github.com/wsanchez
wsanchezhttps://github.com/wsanchez
on Nov 13, 2017https://github.com/python-hyper/hyperlink/issues/44#issuecomment-344093222
https://github.com/glyph
glyphhttps://github.com/glyph
on Nov 16, 2017https://github.com/python-hyper/hyperlink/issues/44#issuecomment-345035115
https://github.com/mahmoud
mahmoudhttps://github.com/mahmoud
on Dec 18, 2017https://github.com/python-hyper/hyperlink/issues/44#issuecomment-352516943
over herehttps://github.com/python-hyper/hyperlink/tree/i44_decoded_url
#48https://github.com/python-hyper/hyperlink/issues/48
@wsanchezhttps://github.com/wsanchez
https://github.com/mahmoud
mahmoudhttps://github.com/mahmoud
on Dec 31, 2017https://github.com/python-hyper/hyperlink/issues/44#issuecomment-354591782
@glyphhttps://github.com/glyph
@wsanchezhttps://github.com/wsanchez
#54https://github.com/python-hyper/hyperlink/pull/54
https://gist.github.com/mahmoud/7bc696254a738404bc281c270b169613https://gist.github.com/mahmoud/7bc696254a738404bc281c270b169613
https://github.com/glyph
glyphhttps://github.com/glyph
on Dec 31, 2017https://github.com/python-hyper/hyperlink/issues/44#issuecomment-354627466
https://github.com/glyph
glyphhttps://github.com/glyph
on Jan 10, 2018https://github.com/python-hyper/hyperlink/issues/44#issuecomment-356701188
https://github.com/mahmoud
mahmoudhttps://github.com/mahmoud
on Jan 10, 2018https://github.com/python-hyper/hyperlink/issues/44#issuecomment-356716658
…https://github.com/python-hyper/hyperlink/issues/44
#44 (comment)https://github.com/python-hyper/hyperlink/issues/44#issuecomment-356701188
https://github.com/notifications/unsubscribe-auth/AAH8kacBt4dZ3IO3rB8JfYz_BKL38o69ks5tJQfBgaJpZM4QH9N5https://github.com/notifications/unsubscribe-auth/AAH8kacBt4dZ3IO3rB8JfYz_BKL38o69ks5tJQfBgaJpZM4QH9N5
https://github.com/glyph
glyphhttps://github.com/glyph
on Jan 10, 2018https://github.com/python-hyper/hyperlink/issues/44#issuecomment-356774480
https://github.com/mahmoud
mahmoudhttps://github.com/mahmoud
on Feb 26, 2018https://github.com/python-hyper/hyperlink/issues/44#issuecomment-368421043
mahmoudhttps://github.com/mahmoud
completedhttps://github.com/python-hyper/hyperlink/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Feb 26, 2018https://github.com/python-hyper/hyperlink/issues/44#event-1491440485
Sign up for freehttps://github.com/signup?return_to=https://github.com/python-hyper/hyperlink/issues/44
Sign in to commenthttps://github.com/login?return_to=https://github.com/python-hyper/hyperlink/issues/44
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.