uri icon indicating copy to clipboard operation
uri copied to clipboard

URI#relative: AttributeError: 'NoneType' object has no attribute 'is_absolute'

Open bossie opened this issue 1 year ago • 1 comments

Example from the docs:

from uri import URI

base = URI("https://example.com/about/us")
cdn = base // "cdn.example.com"

cdn.relative  # boom!

Fails with:

Traceback (most recent call last):
  File "/home/bossie/opt/pycharm-community-2023.3.3/plugins/python-ce/helpers/pydev/pydevconsole.py", line 364, in runcode
    coro = func()
  File "<input>", line 6, in <module>
  File "/home/bossie/PycharmProjects/openeo/venv38/lib/python3.8/site-packages/uri/uri.py", line 254, in relative
    return scheme.is_relative(self)
  File "/home/bossie/PycharmProjects/openeo/venv38/lib/python3.8/site-packages/uri/scheme.py", line 48, in is_relative
    return not uri._host or not uri._path.is_absolute()
AttributeError: 'NoneType' object has no attribute 'is_absolute'

bossie avatar Nov 19 '24 07:11 bossie