HDFGroup / h5pyd

h5py distributed - Python client library for HDF Rest API
Other
110 stars 39 forks source link

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

Open hickey opened 2 years ago

hickey commented 2 years ago

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?