diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-02-04 05:52:47 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-02-04 05:52:47 +0300 |
commit | b7a4aa544884c9a2a1223657875f060ad53b7b1e (patch) | |
tree | 5ea5a343154e03ef5ea465867584ecc557f0f497 /io_scene_x3d/import_x3d.py | |
parent | aee88a06edf374bf30cc69441d2533a44412a3ac (diff) |
Fix T47310: WRML file not imported under OSX
Always use utf8 encoding, with error escaping
Diffstat (limited to 'io_scene_x3d/import_x3d.py')
-rw-r--r-- | io_scene_x3d/import_x3d.py | 7 |
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 |