chiark / gitweb /
Workaround for issue #1136. There is no real fix for unicode in os.path.expanduser...
authordaid <daid303@gmail.com>
Fri, 13 Feb 2015 06:00:00 +0000 (07:00 +0100)
committerdaid <daid303@gmail.com>
Fri, 13 Feb 2015 06:00:00 +0000 (07:00 +0100)
Cura/util/profile.py

index 33b7288f070331ceab8e9cdb1e1b3469174c9d32..7c11c55dfd2baf30e1b80f644f0eeedbedfcd16a 100644 (file)
@@ -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."))