hyperlink
hyperlink copied to clipboard
🔗 Immutable, Pythonic, correct URLs.
The Hypothesis strategies now shipping with Hyperlink are producing this error occasionally in Klein: ```console Traceback (most recent call last): 324 File "/home/runner/work/klein/klein/.tox/coverage-py37-tw192/lib/python3.7/site-packages/klein/test/test_request_compat.py", line 74, in test_uri 325 def test_uri(self,...
I was pretty surprised to discover just now that `DecodedURL.to_uri` returns a `URL` object, rather than a `DecodedURL`. Given that almost all the other methods wrap the passed-through object, why...
With current version of hypothesis: ```pytb $ tox -e py36 GLOB sdist-make: /tmp/hyperlink/setup.py py36 create: /tmp/hyperlink/.tox/py36 py36 installdeps: idna==2.9, pytest==5.2.4, coverage==4.5.4, pytest-cov==2.10.0, hypothesis==5.8.6 py36 inst: /tmp/hyperlink/.tox/.tmp/package/1/hyperlink-20.0.1.dev0.zip py36 installed: atomicwrites==1.4.0,attrs==19.3.0,coverage==4.5.4,hyperlink @...
Per @wsanchez and @twm in #126, consensus seems to be that hyperlink would benefit from an interface/ABC which could be for both DecodedURL and URL/EncodedURL. `AbstractURL` is the current name...
I noticed that [the FAQ entry](https://github.com/python-hyper/hyperlink/blob/df5f7aee5c1241d2512e460826953fc8e2c0d8e8/docs/faq.rst#how-does-hyperlink-compare-to-other-libraries) doesn't mention [`yarl`](https://github.com/aio-libs/yarl). On the surface, both libs seem quite similar, both do the immutable thing, and are IRI-capable. After a (very cursory) review,...
In twisted.python.url I tried *very* hard to eliminate the use of the confusing, vague, and antiquated term "netloc". (NB: neither https://tools.ietf.org/html/rfc3986 nor https://url.spec.whatwg.org includes the string "netloc"). I would therefore...
`test_url.py` has this line: ```python attempted_rooted_replacement = normal_absolute.replace(rooted=True) ``` The variable `attempted_rooted_replacement` is unused and [will be removed in #86 if merged](https://github.com/python-hyper/hyperlink/pull/86/files#diff-7044dec930eaafa2c4fd000a4b2c5676L1115). It should be re-added as something should be...
``` >>> URL.fromText(u"http://[3fff::1]/foo").asURI().asText() Traceback (most recent call last): File "", line 1, in File "/home/hawkowl/venvs/commands/lib/python2.7/site-packages/hyperlink/_url.py", line 1338, in to_uri new_host = self.host if not self.host else idna_encode(self.host, uts46=True).decode("ascii") File "/home/hawkowl/venvs/commands/lib/python2.7/site-packages/idna/core.py",...
Due to hyperlink using `socket.inet_pton()` to parse IPv6, IPv6 zone identifiers aren't supported. ``` >>> hyperlink.URL.from_text(u'https://[fe80:3438:7667:5c77:ce27%eth0]') Traceback (most recent call last): File "", line 1, in File "hyperlink/_url.py", line 1135,...
it seems `hyperlink` does not have a nice way to add path components to a base url, which is a very common operation when interacting with rest apis. for example,...