From: daid Date: Fri, 13 Feb 2015 06:00:00 +0000 (+0100) Subject: Workaround for issue #1136. There is no real fix for unicode in os.path.expanduser... X-Git-Tag: 15.02-RC1~4 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=28ec491518b2d8e1caa9c9c4c6aa7d68efdf4348;p=cura.git Workaround for issue #1136. There is no real fix for unicode in os.path.expanduser for python2 --- diff --git a/Cura/util/profile.py b/Cura/util/profile.py index 33b7288f..7c11c55d 100644 --- a/Cura/util/profile.py +++ b/Cura/util/profile.py @@ -495,7 +495,10 @@ def _getMyDocumentsFolder(): path = os.path.expanduser('~/') if not os.path.exists(path): path = '' - + try: + path = unicode(path) + except UnicodeDecodeError: + path = '' return path setting('sdcard_rootfolder', _getMyDocumentsFolder(), str, 'preference', 'hidden').setLabel(_("Base folder to replicate on SD card"), _("The specified folder will be used as a base path. Any gcode generated from object coming from within that folder will be automatically saved on the SD card at the same sub-folder. Any object coming from outside of this path will save the gcode on the root folder of the card."))