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