changeset 257:aa668ce77d61

fix for handling None buffers
author Alain Mazy <am@orthanc.team>
date Tue, 22 Jul 2025 21:32:31 +0200
parents 10d11de0fcd5
children f198e1c32aed
files CodeAnalysis/GenerateOrthancSDK.py Sources/Autogenerated/sdk_GlobalFunctions.impl.h Sources/Autogenerated/sdk_OrthancPluginFindAnswers.methods.h Sources/Autogenerated/sdk_OrthancPluginFindMatcher.methods.h Sources/Autogenerated/sdk_OrthancPluginRestOutput.methods.h Sources/Autogenerated/sdk_OrthancPluginStorageArea.methods.h Sources/Autogenerated/sdk_OrthancPluginWorklistAnswers.methods.h Sources/Autogenerated/sdk_OrthancPluginWorklistQuery.methods.h
diffstat 8 files changed, 34 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/CodeAnalysis/GenerateOrthancSDK.py	Tue Jul 22 17:18:37 2025 +0200
+++ b/CodeAnalysis/GenerateOrthancSDK.py	Tue Jul 22 21:32:31 2025 +0200
@@ -263,7 +263,7 @@
                 'python_type' : 'Py_buffer',
                 'release' : 'PyBuffer_Release(&%s);' % arg['name'],
             })
-            tuple_format += 's*'
+            tuple_format += 'z*'
         elif arg['sdk_type'] == 'const char *':
             args.append({
                 'name' : arg['name'],
--- a/Sources/Autogenerated/sdk_GlobalFunctions.impl.h	Tue Jul 22 17:18:37 2025 +0200
+++ b/Sources/Autogenerated/sdk_GlobalFunctions.impl.h	Tue Jul 22 21:32:31 2025 +0200
@@ -56,7 +56,7 @@
   const char* arg3 = NULL;
   Py_buffer arg4;
 
-  if (!PyArg_ParseTuple(args, "slsss*", &arg0, &arg1, &arg2, &arg3, &arg4))
+  if (!PyArg_ParseTuple(args, "slssz*", &arg0, &arg1, &arg2, &arg3, &arg4))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (5 arguments expected)");
     return NULL;
@@ -109,7 +109,7 @@
   long int arg2 = 0;
   unsigned char arg3 = 0;
 
-  if (!PyArg_ParseTuple(args, "s*lb", &arg0, &arg2, &arg3))
+  if (!PyArg_ParseTuple(args, "z*lb", &arg0, &arg2, &arg3))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
     return NULL;
@@ -182,7 +182,7 @@
   Py_buffer arg4;
   unsigned char arg5 = 0;
 
-  if (!PyArg_ParseTuple(args, "lkkks*b", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5))
+  if (!PyArg_ParseTuple(args, "lkkkz*b", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (6 arguments expected)");
     return NULL;
@@ -216,7 +216,7 @@
   unsigned long arg3 = 0;
   Py_buffer arg4;
 
-  if (!PyArg_ParseTuple(args, "lkkks*", &arg0, &arg1, &arg2, &arg3, &arg4))
+  if (!PyArg_ParseTuple(args, "lkkkz*", &arg0, &arg1, &arg2, &arg3, &arg4))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (5 arguments expected)");
     return NULL;
@@ -246,7 +246,7 @@
 
   Py_buffer arg0;
 
-  if (!PyArg_ParseTuple(args, "s*", &arg0))
+  if (!PyArg_ParseTuple(args, "z*", &arg0))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
     return NULL;
@@ -275,7 +275,7 @@
 
   Py_buffer arg0;
 
-  if (!PyArg_ParseTuple(args, "s*", &arg0))
+  if (!PyArg_ParseTuple(args, "z*", &arg0))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
     return NULL;
@@ -381,7 +381,7 @@
 
   Py_buffer arg0;
 
-  if (!PyArg_ParseTuple(args, "s*", &arg0))
+  if (!PyArg_ParseTuple(args, "z*", &arg0))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
     return NULL;
@@ -414,7 +414,7 @@
 
   Py_buffer arg0;
 
-  if (!PyArg_ParseTuple(args, "s*", &arg0))
+  if (!PyArg_ParseTuple(args, "z*", &arg0))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
     return NULL;
@@ -516,7 +516,7 @@
   Py_buffer arg0;
   unsigned long arg2 = 0;
 
-  if (!PyArg_ParseTuple(args, "s*k", &arg0, &arg2))
+  if (!PyArg_ParseTuple(args, "z*k", &arg0, &arg2))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
     return NULL;
@@ -584,7 +584,7 @@
   long int arg3 = 0;
   unsigned long arg4 = 0;
 
-  if (!PyArg_ParseTuple(args, "s*llk", &arg0, &arg2, &arg3, &arg4))
+  if (!PyArg_ParseTuple(args, "z*llk", &arg0, &arg2, &arg3, &arg4))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)");
     return NULL;
@@ -646,7 +646,7 @@
   const char* arg0 = NULL;
   Py_buffer arg1;
 
-  if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1))
+  if (!PyArg_ParseTuple(args, "sz*", &arg0, &arg1))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
     return NULL;
@@ -1252,7 +1252,7 @@
   const char* arg3 = NULL;
   const char* arg4 = NULL;
 
-  if (!PyArg_ParseTuple(args, "ss*ss", &arg0, &arg1, &arg3, &arg4))
+  if (!PyArg_ParseTuple(args, "sz*ss", &arg0, &arg1, &arg3, &arg4))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)");
     return NULL;
@@ -1285,7 +1285,7 @@
   const char* arg3 = NULL;
   const char* arg4 = NULL;
 
-  if (!PyArg_ParseTuple(args, "ss*ss", &arg0, &arg1, &arg3, &arg4))
+  if (!PyArg_ParseTuple(args, "sz*ss", &arg0, &arg1, &arg3, &arg4))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)");
     return NULL;
@@ -1846,7 +1846,7 @@
   const char* arg0 = NULL;
   Py_buffer arg1;
 
-  if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1))
+  if (!PyArg_ParseTuple(args, "sz*", &arg0, &arg1))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
     return NULL;
@@ -1877,7 +1877,7 @@
   const char* arg0 = NULL;
   Py_buffer arg1;
 
-  if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1))
+  if (!PyArg_ParseTuple(args, "sz*", &arg0, &arg1))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
     return NULL;
@@ -1908,7 +1908,7 @@
   const char* arg0 = NULL;
   Py_buffer arg1;
 
-  if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1))
+  if (!PyArg_ParseTuple(args, "sz*", &arg0, &arg1))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
     return NULL;
@@ -1939,7 +1939,7 @@
   const char* arg0 = NULL;
   Py_buffer arg1;
 
-  if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1))
+  if (!PyArg_ParseTuple(args, "sz*", &arg0, &arg1))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
     return NULL;
@@ -1970,7 +1970,7 @@
   const char* arg0 = NULL;
   Py_buffer arg1;
 
-  if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1))
+  if (!PyArg_ParseTuple(args, "sz*", &arg0, &arg1))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
     return NULL;
@@ -2180,7 +2180,7 @@
   const char* arg1 = NULL;
   Py_buffer arg2;
 
-  if (!PyArg_ParseTuple(args, "sss*", &arg0, &arg1, &arg2))
+  if (!PyArg_ParseTuple(args, "ssz*", &arg0, &arg1, &arg2))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
     return NULL;
@@ -2212,7 +2212,7 @@
   Py_buffer arg0;
   const char* arg2 = NULL;
 
-  if (!PyArg_ParseTuple(args, "s*s", &arg0, &arg2))
+  if (!PyArg_ParseTuple(args, "z*s", &arg0, &arg2))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
     return NULL;
@@ -2246,7 +2246,7 @@
   Py_buffer arg0;
   long int arg2 = 0;
 
-  if (!PyArg_ParseTuple(args, "s*l", &arg0, &arg2))
+  if (!PyArg_ParseTuple(args, "z*l", &arg0, &arg2))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
     return NULL;
@@ -2280,7 +2280,7 @@
   const char* arg0 = NULL;
   Py_buffer arg1;
 
-  if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1))
+  if (!PyArg_ParseTuple(args, "sz*", &arg0, &arg1))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
     return NULL;
--- a/Sources/Autogenerated/sdk_OrthancPluginFindAnswers.methods.h	Tue Jul 22 17:18:37 2025 +0200
+++ b/Sources/Autogenerated/sdk_OrthancPluginFindAnswers.methods.h	Tue Jul 22 21:32:31 2025 +0200
@@ -41,7 +41,7 @@
 
   Py_buffer arg0;
 
-  if (!PyArg_ParseTuple(args, "s*", &arg0))
+  if (!PyArg_ParseTuple(args, "z*", &arg0))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
     return NULL;
--- a/Sources/Autogenerated/sdk_OrthancPluginFindMatcher.methods.h	Tue Jul 22 17:18:37 2025 +0200
+++ b/Sources/Autogenerated/sdk_OrthancPluginFindMatcher.methods.h	Tue Jul 22 21:32:31 2025 +0200
@@ -41,7 +41,7 @@
 
   Py_buffer arg0;
 
-  if (!PyArg_ParseTuple(args, "s*", &arg0))
+  if (!PyArg_ParseTuple(args, "z*", &arg0))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
     return NULL;
--- a/Sources/Autogenerated/sdk_OrthancPluginRestOutput.methods.h	Tue Jul 22 17:18:37 2025 +0200
+++ b/Sources/Autogenerated/sdk_OrthancPluginRestOutput.methods.h	Tue Jul 22 21:32:31 2025 +0200
@@ -42,7 +42,7 @@
   Py_buffer arg0;
   const char* arg2 = NULL;
 
-  if (!PyArg_ParseTuple(args, "s*s", &arg0, &arg2))
+  if (!PyArg_ParseTuple(args, "z*s", &arg0, &arg2))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
     return NULL;
@@ -75,7 +75,7 @@
   unsigned long arg3 = 0;
   Py_buffer arg4;
 
-  if (!PyArg_ParseTuple(args, "lkkks*", &arg0, &arg1, &arg2, &arg3, &arg4))
+  if (!PyArg_ParseTuple(args, "lkkkz*", &arg0, &arg1, &arg2, &arg3, &arg4))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (5 arguments expected)");
     return NULL;
@@ -319,7 +319,7 @@
 
   Py_buffer arg0;
 
-  if (!PyArg_ParseTuple(args, "s*", &arg0))
+  if (!PyArg_ParseTuple(args, "z*", &arg0))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
     return NULL;
@@ -358,7 +358,7 @@
   unsigned short arg0 = 0;
   Py_buffer arg1;
 
-  if (!PyArg_ParseTuple(args, "Hs*", &arg0, &arg1))
+  if (!PyArg_ParseTuple(args, "Hz*", &arg0, &arg1))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
     return NULL;
@@ -392,7 +392,7 @@
   Py_buffer arg4;
   unsigned char arg5 = 0;
 
-  if (!PyArg_ParseTuple(args, "lkkks*b", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5))
+  if (!PyArg_ParseTuple(args, "lkkkz*b", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (6 arguments expected)");
     return NULL;
@@ -489,7 +489,7 @@
 
   Py_buffer arg0;
 
-  if (!PyArg_ParseTuple(args, "s*", &arg0))
+  if (!PyArg_ParseTuple(args, "z*", &arg0))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
     return NULL;
--- a/Sources/Autogenerated/sdk_OrthancPluginStorageArea.methods.h	Tue Jul 22 17:18:37 2025 +0200
+++ b/Sources/Autogenerated/sdk_OrthancPluginStorageArea.methods.h	Tue Jul 22 21:32:31 2025 +0200
@@ -44,7 +44,7 @@
   unsigned long long arg2 = 0;
   long int arg3 = 0;
 
-  if (!PyArg_ParseTuple(args, "ss*Kl", &arg0, &arg1, &arg2, &arg3))
+  if (!PyArg_ParseTuple(args, "sz*Kl", &arg0, &arg1, &arg2, &arg3))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)");
     return NULL;
--- a/Sources/Autogenerated/sdk_OrthancPluginWorklistAnswers.methods.h	Tue Jul 22 17:18:37 2025 +0200
+++ b/Sources/Autogenerated/sdk_OrthancPluginWorklistAnswers.methods.h	Tue Jul 22 21:32:31 2025 +0200
@@ -42,7 +42,7 @@
   PyObject* arg0 = NULL;
   Py_buffer arg1;
 
-  if (!PyArg_ParseTuple(args, "Os*", &arg0, &arg1))
+  if (!PyArg_ParseTuple(args, "Oz*", &arg0, &arg1))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
     return NULL;
--- a/Sources/Autogenerated/sdk_OrthancPluginWorklistQuery.methods.h	Tue Jul 22 17:18:37 2025 +0200
+++ b/Sources/Autogenerated/sdk_OrthancPluginWorklistQuery.methods.h	Tue Jul 22 21:32:31 2025 +0200
@@ -41,7 +41,7 @@
 
   Py_buffer arg0;
 
-  if (!PyArg_ParseTuple(args, "s*", &arg0))
+  if (!PyArg_ParseTuple(args, "z*", &arg0))
   {
     PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
     return NULL;