Skip to content


fixed 'exclude command raise UnicodeDecodeError'
Browse files Browse the repository at this point in the history
  • Loading branch information
toaco authored and raveit65 committed Jan 9, 2019
1 parent 5543711 commit a939670
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions
Expand Up @@ -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)
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)
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.
Expand Down

0 comments on commit a939670

Please sign in to comment.