bmwcarit / python-dlt

python-dlt is a thin Python ctypes wrapper around libdlt functions
Mozilla Public License 2.0
34 stars 29 forks source link

Fix string passing to c_char_p for Python3 #61

Closed aigarius closed 1 year ago

aigarius commented 1 year ago

Fixes the following crash type.

2023-09-19T12:56:54.573054233Z Traceback (most recent call last):
2023-09-19T12:56:54.573056465Z File "/env/lib/python3.10/site-packages/dlt/dlt_broker_handlers.py", line 439, in run
2023-09-19T12:56:54.573058357Z res = py_dlt_client_main_loop(self._client, verbose=0, callback=self.handle, dumpfile=self.tracefile)
2023-09-19T12:56:54.573060056Z File "/env/lib/python3.10/site-packages/dlt/dlt.py", line 1124, in py_dlt_client_main_loop
2023-09-19T12:56:54.573061874Z msg = client.read_message(verbose)
2023-09-19T12:56:54.573063452Z File "/env/lib/python3.10/site-packages/dlt/dlt.py", line 1022, in read_message
2023-09-19T12:56:54.573065232Z dltlib.dlt_set_storageheader(msg.p_storageheader, ctypes.c_char_p(""))
2023-09-19T12:56:54.573066913Z TypeError: bytes or integer address expected instead of str instance