From ec0af2cb2f6bdd60320f9fef855384843af1536f Mon Sep 17 00:00:00 2001 From: paulojamorim Date: Mon, 4 Jan 2010 10:53:49 +0000 Subject: [PATCH] FIX: Error in the Windows XP 32 bits open directory with accent. --- invesalius/gui/dialogs.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/invesalius/gui/dialogs.py b/invesalius/gui/dialogs.py index 9ded49c..232257a 100644 --- a/invesalius/gui/dialogs.py +++ b/invesalius/gui/dialogs.py @@ -171,8 +171,11 @@ def ShowImportDirDialog(): if dlg.ShowModal() == wx.ID_OK: # GetPath returns in unicode, if a path has non-ascii characters a # UnicodeEncodeError is raised. To avoid this, path is encoded in utf-8 - path = dlg.GetPath().encode('utf-8') - + if sys.platform == "win32": + path = dlg.GetPath() + else: + path = dlg.GetPath().encode('utf-8') + # Only destroy a dialog after you're done with it. dlg.Destroy() os.chdir(current_dir) -- libgit2 0.21.2