diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2015-03-01 16:25:46 +0100 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2015-03-01 16:25:46 +0100 |
commit | e420859e28e950e2761829612816145b6e1232e9 (patch) | |
tree | 4145d113e3ed2974d39bbf97dd4f740fe83d8fd1 | |
parent | 4da5111224a7aa00a07dd4fdb2bca98687291532 (diff) | |
download | fuse-httpfs-e420859e28e950e2761829612816145b6e1232e9.tar.gz fuse-httpfs-e420859e28e950e2761829612816145b6e1232e9.zip |
fix issues with special chars
-rw-r--r-- | httpfs/__init__.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/httpfs/__init__.py b/httpfs/__init__.py index f0359e3..de4449c 100644 --- a/httpfs/__init__.py +++ b/httpfs/__init__.py @@ -29,7 +29,7 @@ class Path: self.initialized = False def buildUrl(self): - return self.parent.buildUrl() + "/" + quote(self.name) + return self.parent.buildUrl() + "/" + quote(self.name.encode('utf-8')) def getSession(self): return self.parent.getSession() @@ -39,6 +39,8 @@ class Path: @classmethod def fromPath(clazz, parent, pathElement): + if type(pathElement) == bytes: + pathElement = pathElement.decode('utf-8') p = clazz(parent, unquote(pathElement)) logging.info("created {} '{}' referencing {}".format( clazz.__name__, p.name, p.buildUrl())) @@ -99,7 +101,7 @@ class Directory(Path): self.entries = {} def init(self): - url = self.buildUrl() + url = self.buildUrl() + "/" logging.info("Directory url={} name={}".format(url, self.name)) r = self.getSession().get(url, stream=True, timeout=Config.timeout) if r.status_code != 200: |