Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2016-02-04 05:52:47 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-02-04 05:52:47 +0300
commitb7a4aa544884c9a2a1223657875f060ad53b7b1e (patch)
tree5ea5a343154e03ef5ea465867584ecc557f0f497
parentaee88a06edf374bf30cc69441d2533a44412a3ac (diff)
Fix T47310: WRML file not imported under OSX
Always use utf8 encoding, with error escaping
-rw-r--r--io_scene_x3d/import_x3d.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/io_scene_x3d/import_x3d.py b/io_scene_x3d/import_x3d.py
index 22f7ee47..d5494d6b 100644
--- a/io_scene_x3d/import_x3d.py
+++ b/io_scene_x3d/import_x3d.py
@@ -1266,13 +1266,14 @@ def gzipOpen(path):
if data is None:
try:
- filehandle = open(path, 'rU')
+ filehandle = open(path, 'rU', encoding='utf-8', errors='surrogateescape')
data = filehandle.read()
filehandle.close()
except:
- pass
+ import traceback
+ traceback.print_exc()
else:
- data = data.decode('utf-8', "replace")
+ data = data.decode(encoding='utf-8', errors='surrogateescape')
return data