summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Teo <[email protected]>2017-05-20 00:00:31 +0800
committerraveit65 <[email protected]>2019-01-09 20:05:00 +0100
commita939670f3ff160fa5fc79eca3f30f9a7504f7316 (patch)
tree5e2c015f083233e3bb99fe5ae73b8ca53213220e
parent5543711e5c6667e5da4b7c5e2f7504e12fc9ee6d (diff)
downloadcaja-dropbox-a939670f3ff160fa5fc79eca3f30f9a7504f7316.tar.bz2
caja-dropbox-a939670f3ff160fa5fc79eca3f30f9a7504f7316.tar.xz
fixed 'exclude command raise UnicodeDecodeError'
origin commit: https://github.com/dropbox/nautilus-dropbox/commit/bd8caf8 https://github.com/dropbox/nautilus-dropbox/issues/28
-rwxr-xr-xcaja-dropbox.in11
1 files changed, 6 insertions, 5 deletions
diff --git a/caja-dropbox.in b/caja-dropbox.in
index b572bc9..27f622f 100755
--- a/caja-dropbox.in
+++ b/caja-dropbox.in
@@ -100,14 +100,15 @@ def relpath(path, start=curdir):
if not path:
raise ValueError("no path specified")
- if type(start) is unicode:
- start_list = unicode_abspath(start).split(sep)
- else:
- start_list = abspath(start).split(sep)
-
if type(path) is unicode:
+ if isinstance(start,str):
+ start = start.decode(sys.getfilesystemencoding())
+ start_list = unicode_abspath(start).split(sep)
path_list = unicode_abspath(path).split(sep)
else:
+ if isinstance(start,unicode):
+ start = start.encode(sys.getfilesystemencoding())
+ start_list = abspath(start).split(sep)
path_list = abspath(path).split(sep)
# Work out how much of the filepath is shared by start and path.