You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exception is thrown when trying to check if file exists
^^^^^^^^^^^^^^^^^^^^
File "/venv/lib/python3.12/site-packages/storage3/_async/file_api.py", line 53, in _request
resp = exc.response.json()
^^^^^^^^^^^^^^^^^^^
To Reproduce
Check to see if a file exists, which does not actually exist.
Expected behavior
Returns false
It appears that the _request method always calls raise_for_status, which throws if the file does not exist due to the status code, but in this case the body does not contain json, so it fails to parse the json in the except handler and blows up, instead of passing through the original request.
Changing _request to not raise_for_status when method = "HEAD" seems to resolve the issue.
The text was updated successfully, but these errors were encountered:
Please provide code example of the method you are referring to in your issue. Also note the Python library throws exception rather than return boolean in its code base.
Describe the bug
Exception is thrown when trying to check if file exists
To Reproduce
Check to see if a file exists, which does not actually exist.
Expected behavior
Returns false
It appears that the _request method always calls raise_for_status, which throws if the file does not exist due to the status code, but in this case the body does not contain json, so it fails to parse the json in the except handler and blows up, instead of passing through the original request.
Changing _request to not raise_for_status when method = "HEAD" seems to resolve the issue.
The text was updated successfully, but these errors were encountered: