-
Notifications
You must be signed in to change notification settings - Fork 95
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
Bug with URL quote/unquote #11
Comments
I'm sorry to say that I have no capacity for the foreseeable future to look into this (though I'm not able to foresee much of the future - in the very best case, perhaps I will have time in some few weeks). Perhaps you could make a pull request? I think it's important to include some test code that throws an error with the current code in the pull request. I'm generally having a low threshold for accepting pull requests, though I will do more thorough testing before the next release. |
I am not sure I will find time to put together proper fix (with test), but I will try. |
… quoted Minor optimization of search in a dictionary ref python-caldav#11
I can confirm that this solves the problem (thank you very much for this, andrei-mart). |
pull request has been accepted, but I still didn't get to release a new version |
OK, I see. Thanks :). |
I believe this was fixed and that this issue can be closed |
in caldav/objects.py:
DAVObject._handle_prop_response() unqotes key it returns:
line 174:
href = unquote(r.find('.//' + dav.Href.tag).text)
but in DAVObject.get_properties it is compared to URL path, which is quoted:
lines 209-218:
path = self.url.path
exchange_path = self.url.path + '/'
So, if base path contains quoted characters, they do not match and the server is blamed.
Following modification makes it working for me:
lines 209-210:
path = unquote(self.url.path)
exchange_path = path + '/'
Also, a small optimisation in lines 212 and 214:
'in properties' is equivalent of 'in list(properties.keys())', but more effective.
The text was updated successfully, but these errors were encountered: