-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
owncloud.Client.file_info() is not returning None when file is not found. #250
Comments
i've just stumbled upon this issue, as suddenly after a change in my infra all Imo, the exception should be catched/handled inside |
@PVince81 since you recently commited again to this module and made a release, can you have a look at this issue, at least acknowledging it ? thanks ! |
i've tested this against pyocclient 0.4, first test when doing file_info on a non existing file on a nginx instance with the two
commented out the two lines in the nginx config, reloaded it:
the test code is:
done the same test against pyocclient 0.6:
that produces the same exact result, so the issue is still present. |
of course, a workaround client side would be to wrap all
|
According to line 416,
owncloud.Client.file_info()
should returnNone
if file is not found. Instead anHTTPResponseError: HTTP error: 404
is thrown.According to OwnCloud's developer manual, an
HTTP/1.1 404 Not Found
is the expected response if file is not found. Currently, an exception is thrown by owncloud.Client._make_dav_request() and it has not been caught inowncloud.Client.file_info()
.EDIT:
Suggestion: Amend the description of file_info(), or add a feature to check if file exists without resulting a 404 Not Found Error.
The text was updated successfully, but these errors were encountered: