From 5cc2f0d941ed7cf34092e5083b7a9a189bc84aec Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Fri, 5 May 2017 15:38:48 -0700 Subject: [PATCH] Fix unicode() issue for python3 --- dvc/system.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dvc/system.py b/dvc/system.py index b67f840f3..43c52053a 100644 --- a/dvc/system.py +++ b/dvc/system.py @@ -1,6 +1,7 @@ import ctypes import os import re +from builtins import str if os.name == 'nt': from ctypes import create_unicode_buffer, windll @@ -85,7 +86,7 @@ class System(object): buffer = create_unicode_buffer(System.LONG_PATH_BUFFER_SIZE) get_long_path_name = windll.kernel32.GetLongPathNameW - result = get_long_path_name(unicode(path), buffer, System.LONG_PATH_BUFFER_SIZE) + result = get_long_path_name(u'%s' % str(path), buffer, System.LONG_PATH_BUFFER_SIZE) if result == 0 or result > System.LONG_PATH_BUFFER_SIZE: return path return buffer.value