Fix calls to os.path.expanduser with unicode strings.

expanduser does not handle unicode strings correctly, tries to decode using ASCII instead of FS encoding. Only workaround is to pass bytestrings
This commit is contained in:
David Vierra 2015-05-11 18:16:19 -10:00
parent 1961997d20
commit a2c9093ee4
2 changed files with 2 additions and 2 deletions

View File

@ -715,7 +715,7 @@ class MCEditApp(QtGui.QApplication):
NotImplementedYet()
def chooseOpenWorld(self):
startingDir = Settings().value("open_world_dialog/starting_dir", os.path.expanduser("~"))
startingDir = Settings().value("open_world_dialog/starting_dir", os.path.expanduser(b"~"))
result = QtGui.QFileDialog.getOpenFileName(self.mainWindow, self.tr("Open World, Level or Schematic"),
startingDir,
"All files (*.*)")

View File

@ -61,7 +61,7 @@ def setup_logging():
if sys.platform == "darwin":
log_debug("OS X found.")
logfile = os.path.expanduser("~/Library/Logs/" + logfilename)
logfile = os.path.expanduser(b"~/Library/Logs/" + logfilename)
else:
logfile = abslogfile
else: