From f4fd5840b143b5e57cbb820e9804386d414b6bf3 Mon Sep 17 00:00:00 2001 From: Andor Goetzendorff Date: Tue, 15 May 2018 15:22:19 +0200 Subject: [PATCH] Encode filename using file system encoding instead of ASCII --- port/PyAssimp/pyassimp/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/port/PyAssimp/pyassimp/core.py b/port/PyAssimp/pyassimp/core.py index 573ce27b1..8950e54aa 100644 --- a/port/PyAssimp/pyassimp/core.py +++ b/port/PyAssimp/pyassimp/core.py @@ -312,7 +312,7 @@ def load(filename, file_type) else: # a filename string has been passed - model = _assimp_lib.load(filename.encode("ascii"), processing) + model = _assimp_lib.load(filename.encode(sys.getfilesystemencoding()), processing) if not model: raise AssimpError('Could not import file!') @@ -342,7 +342,7 @@ def export(scene, ''' from ctypes import pointer - exportStatus = _assimp_lib.export(pointer(scene), file_type.encode("ascii"), filename.encode("ascii"), processing) + exportStatus = _assimp_lib.export(pointer(scene), file_type.encode("ascii"), filename.encode(sys.getfilesystemencoding()), processing) if exportStatus != 0: raise AssimpError('Could not export scene!')