python-hyper/hyperlink

URL().child() fails with a TypeError

Julian opened this issue · 2 comments

python -c 'from hyperlink import URL; URL.from_text(u"http://example.com").child()'

produces

Traceback (most recent call last):
  File "<module>", line 1, in <module>
  File "/Users/Julian/.local/share/virtualenvs/dev/site-packages/hyperlink/_url.py", line 1099, in child
    else None] + new_segs
TypeError: unsupported operand type(s) for +: 'tuple' and 'list'

probably would be nice for that to just return the original URL. If it's intentionally an error though, one that says that the argument is required would be nice.

Hey Julian! Thanks for submitting lucky #42. I agree this is a bug and returning the original URL is a better behavior. I'd love it if you'd submit a PR that I could review and merge to avoid probably having to self-merge, but no obligation! :) Thanks again!

Done in lucky #43 -- thanks!