Merge pull request #1964 from ruxkor/master

PyAssimp: Encode filename using file system encoding instead of ASCII
pull/1960/head^2
Kim Kulling 2018-05-15 20:30:51 +02:00 committed by GitHub
commit 8f587b9750
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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!')