Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Properly handle utf-8 encoded resource names.
  • Loading branch information
cyrusdaboo committed Dec 15, 2016
1 parent 38bffa4 commit 10948a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions txweb2/dav/test/test_util.py
@@ -1,3 +1,4 @@
# coding=utf-8
##
# Copyright (c) 2005-2016 Apple Inc. All rights reserved.
#
Expand Down Expand Up @@ -68,6 +69,7 @@ def test_joinURL(self):
self.assertEquals(util.joinURL("/foo/../", "/bar"), "/bar")
self.assertEquals(util.joinURL("/foo", "/../"), "/")
self.assertEquals(util.joinURL("/foo", "/./"), "/foo/")
self.assertEquals(util.joinURL("/foo", "båa"), "/foo/båa")

def test_parentForURL(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion txweb2/dav/util.py
Expand Up @@ -122,7 +122,7 @@ def cleanup(path):
count += 1
path = path[count - 1:]

return path.encode("utf-8")
return path.encode("utf-8") if isinstance(path, unicode) else path

(scheme, host, path, query, fragment) = urlsplit(cleanup(url))

Expand Down

0 comments on commit 10948a7

Please sign in to comment.