hyperlink icon indicating copy to clipboard operation
hyperlink copied to clipboard

🔗 Immutable, Pythonic, correct URLs.

Results 33 hyperlink issues
Sort by recently updated
recently updated
newest added

Upgrade to actions/setup-python@v2 and Python 3.10 https://pythoninsider.blogspot.com/2021/10/python-3100-is-available.html "3.10" ___must___ be quoted in YAML. https://dev.to/hugovk/the-python-3-1-problem-85g

``` >>> u DecodedURL(url=URL.from_text('https://example.com/api/v1/webui')) >>> u.replace(path="support/woo") DecodedURL(url=URL.from_text('https://example.com/s/u/p/p/o/r/t/%2F/w/o/o'')) ``` I know `path` is supposed to be an iterable, not a string in this case, i.e. I should have done `path=["support", "woo"]`....

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-hyperlink-21.0.0-3.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-hyperlink-21.0.0-3.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/python3 -Bm pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.9, pytest-6.2.3, py-1.10.0, pluggy-0.13.1 rootdir: /home/tkloczko/rpmbuild/BUILD/hyperlink-21.0.0, configfile: pytest.ini plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, asyncio-0.14.0,...

Seems the parse function generate an error for this URL: `http://www.test.com/BMF%20Ver%F6ffentlichungen?` Logs: ``` >>> import hyperlink >>> hyperlink.parse("http://www.test.com/BMF%20Ver%F6ffentlichungen?") Traceback (most recent call last): File "", line 1, in File "/home/damien/dd2/.venv/lib/python3.9/site-packages/hyperlink/_url.py",...

If people type URLs as browsers display them, and then attempt to parse that, they silently get a slightly confusing, although *technically* correct, result: ```python3 >>> link = hyperlink.DecodedURL.from_text("example.com/some-path?some=query") >>>...

```python from hyperlink import URL url1 = URL.from_text(u"http://example.test./,") url2 = URL.from_text(u"http://example.test./%2c") assert url1 != url2 assert url1.to_iri() == url2.to_iri() ``` It seems surprising to me that `to_iri()` provides a level...

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`: ```py...

This is weird, but browsers don't usually escape `|`; Chrome only escapes it in URL path, but not in query; Firefox doesn't escape it at all. See https://github.com/scrapy/w3lib/pull/25#issuecomment-305752348.

This looks like a very good resource to make sure we're handling every encoding edge-case correctly: https://github.com/web-platform-tests/wpt/tree/77da471a234e03e65a22ee6df8ceff7aaba391f8/url

Our recent exciting foray into making handling of + more correct (#129) had some exciting consequences for our codebase at work, but in ways that were surprisingly hard to detect....