h5pyd icon indicating copy to clipboard operation
h5pyd copied to clipboard

Ending the `endpoint` parameter in a `/` causes an error

Open hickey opened this issue 3 years ago • 0 comments

I have found (although it really should be another issue) that the endpoint parameter acts differently if there is a slash at the end of the value.

>>> f = h5pyd.File('test4', 'r', endpoint='https://h5.wt0f.com/', username='xxxx', password='xxxxx')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/h5pyd/_hl/files.py", line 236, in __init__
    raise IOError(rsp.status_code, rsp.reason)
OSError: [Errno 400] Bad Request
>>> f = h5pyd.File('test4', 'r', endpoint='https://h5.wt0f.com', username='xxxx', password='xxxx')
>>>

That just seems wrong to me. If there is a reason that a final slash is not acceptable, should there be a test to remove the final slash if it is supplied?

hickey avatar Sep 15 '21 03:09 hickey