diff options
author | Jeffrey Teo <[email protected]> | 2017-05-20 00:00:31 +0800 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-01-09 20:05:00 +0100 |
commit | a939670f3ff160fa5fc79eca3f30f9a7504f7316 (patch) | |
tree | 5e2c015f083233e3bb99fe5ae73b8ca53213220e | |
parent | 5543711e5c6667e5da4b7c5e2f7504e12fc9ee6d (diff) | |
download | caja-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-x | caja-dropbox.in | 11 |
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. |