From d1edaa949bbf55b520fbc7e749293423f507eb8a Mon Sep 17 00:00:00 2001 From: Marco Feuerstein Date: Thu, 29 Jun 2023 14:51:16 +0200 Subject: [PATCH] Fix passing of file extension string. Previously only the first letter of the string was passed to c, now it passes the whole extension. --- port/PyAssimp/pyassimp/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/port/PyAssimp/pyassimp/core.py b/port/PyAssimp/pyassimp/core.py index edde8b29a..f891b5d40 100644 --- a/port/PyAssimp/pyassimp/core.py +++ b/port/PyAssimp/pyassimp/core.py @@ -311,6 +311,7 @@ def load(filename, Scene object with model data ''' + from ctypes import c_char_p if hasattr(filename, 'read'): # This is the case where a file object has been passed to load. # It is calling the following function: @@ -324,7 +325,7 @@ def load(filename, model = _assimp_lib.load_mem(data, len(data), processing, - file_type) + c_char_p(file_type.encode(sys.getfilesystemencoding()))) else: # a filename string has been passed model = _assimp_lib.load(filename.encode(sys.getfilesystemencoding()), processing)