From f17d58cadd714dda9ad186a465234a714727ed63 Mon Sep 17 00:00:00 2001 From: Eric Olson Date: Tue, 4 May 2021 13:38:38 -0500 Subject: [PATCH] Use POINTER(c_char) for binary data with pyassimp "For a general character pointer that may also point to binary data, POINTER(c_char) must be used." c_char_p is for a zero-terminated string. Reference: https://docs.python.org/3/library/ctypes.html#ctypes.c_char_p Applying this change to the 4.1.4 released python module fixes #2339 for me in Ubuntu. --- port/PyAssimp/pyassimp/structs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/port/PyAssimp/pyassimp/structs.py b/port/PyAssimp/pyassimp/structs.py index 809afae54..e1fba1950 100644 --- a/port/PyAssimp/pyassimp/structs.py +++ b/port/PyAssimp/pyassimp/structs.py @@ -1,6 +1,6 @@ #-*- coding: utf-8 -*- -from ctypes import POINTER, c_void_p, c_uint, c_char, c_float, Structure, c_char_p, c_double, c_ubyte, c_size_t, c_uint32 +from ctypes import POINTER, c_void_p, c_uint, c_char, c_float, Structure, c_double, c_ubyte, c_size_t, c_uint32 class Vector2D(Structure): @@ -1121,7 +1121,7 @@ class Scene(Structure): ("mMetadata", POINTER(Metadata)), # Internal data, do not touch - ("mPrivate", c_char_p), + ("mPrivate", POINTER(c_char)), ] assimp_structs_as_tuple = (Matrix4x4,