From d8051d0c5d397d080dcce2700951befe90bdb907 Mon Sep 17 00:00:00 2001 From: Vital Kolas Date: Mon, 23 Mar 2015 14:00:49 +0300 Subject: [PATCH] Fix url if WebDav path containing not escaped characters --- easywebdav/client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/easywebdav/client.py b/easywebdav/client.py index 4003198..fd16c71 100644 --- a/easywebdav/client.py +++ b/easywebdav/client.py @@ -9,9 +9,10 @@ if py_majversion == '2': from httplib import responses as HTTP_CODES from urlparse import urlparse + from urllib import quote else: from http.client import responses as HTTP_CODES - from urllib.parse import urlparse + from urllib.parse import urlparse, quote DOWNLOAD_CHUNK_SIZE_BYTES = 1 * 1024 * 1024 @@ -101,7 +102,7 @@ def _send(self, method, path, expected_code, **kwargs): return response def _get_url(self, path): - path = str(path).strip() + path = quote(str(path).strip()) if path.startswith('/'): return self.baseurl + path return "".join((self.baseurl, self.cwd, path))