From d3993f57ff62c4735c99499a6b6e1cb5db75e1ef Mon Sep 17 00:00:00 2001 From: Peter Landgren Date: Wed, 13 Oct 2010 08:45:23 +0000 Subject: [PATCH] Issue 4291, wrong path when cancel. svn: r15975 --- src/Utils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Utils.py b/src/Utils.py index ea852eea9..ae14978f2 100644 --- a/src/Utils.py +++ b/src/Utils.py @@ -333,12 +333,12 @@ def get_unicode_path_from_file_chooser(path): :rtype: unicode :returns: The Unicode version of path. """ - # Don't make unicode of unicode - if isinstance(path, unicode): + # make omly unicode of path of type 'str' + if not (isinstance(path, str)): return path if constfunc.win(): - # in windows filechooser returns officially utf-8, not filesystemencoding + # in windows filechooser returns officially utf-8, not filesystemencoding try: return unicode(path) except: @@ -360,7 +360,8 @@ def get_unicode_path_from_env_var(path): :rtype: unicode :returns: The Unicode version of path. """ - if isinstance(path, unicode): + # make omly unicode of path of type 'str' + if not (isinstance(path, str)): return path if constfunc.win():