GNOME Bugzilla – Bug 603422
listing directories or downloading files with percent encoded parentheses characters fails
Last modified: 2011-05-17 16:55:05 UTC
Parentheses are not required to be encoded, but GVFS should be able to parse responses in which they are encoded as it is valid to do so. When working with such filenames on my sever, I get: Could not display "dav://zest/shot/work-gauthierm/www/dav/photos-test/test3%20(copy)". Error: Response invalid Please select another viewer and try again. The raw XML document corresponding to the error message as sent by my server is: <?xml version="1.0" encoding="utf-8"?> <d:multistatus xmlns:d="DAV:" xmlns:s="http://www.rooftopsolutions.nl/NS/sabredav"><d:response><d:href>/shot/work-gauthierm/www/dav/photos-test/photos%20%28copy%29/</d:href><d:propstat><d:prop><d:getlastmodified xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/" b:dt="dateTime.rfc1123">Mon, 30 Nov 2009 15:09:31 +0000</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype></d:prop><d:status>HTTP/1.1 200 Ok</d:status></d:propstat><d:propstat><d:prop><d:creationdate/><d:displayname/><d:getcontentlength/><d:getcontenttype/><d:getetag/></d:prop><d:status>HTTP/1.1 404 Not Found</d:status></d:propstat></d:response></d:multistatus> Note that the ( and ) characters are encoded as %28 and %29 respectively. If these characters are not sent encoded by my server, GVFS parses the result properly.
using version gvfs-1.4.1-0ubuntu1 on Ubuntu 9.10
I can confirm this issue. Even though parenthesis don't have any special meanings in path segments, any urlencoded value must be decoded; which clearly doesn't happen here. In this particular case this was solved by writing a custom url encoder, that ignores parenthesis: http://code.google.com/p/sabredav/source/browse/lib/Sabre/DAV/URLUtil.php#41
More info on this: I only just found out that this is happening because urls are percent-encoded lowercase (%c3%a1), while gvfs sends them uppercase (%C3%A1). A bug report detailing this is here: http://code.google.com/p/sabredav/issues/detail?id=83 So note that this is still an issue as of gvfs 1.6.1 on ubuntu 10.10. If there's anything I can do to assist with solving this bug, I'll be glad to hear it.
Ok it looks like the initial parenthesis issue is unrelated to the casing-issue, because the parenthesis only actually contain numbers. I suspect this _is_ the same bug though, urls and path-parts must be decoded before comparison.
This is a duplicated of bug 629660 (and maybe also bug 561515). Thanks for the analysis Evert, you were 100% correct. *** This bug has been marked as a duplicate of bug 629660 ***