# HG changeset patch # User Sebastien Jodogne # Date 1693384346 -7200 # Node ID 9ffe8881f8566df0b8a81cc3ef562ea236828664 # Parent 262189b417cd1128993eca6b16be82714ce56bb0 fixing more PyDict_SetItemString() diff -r 262189b417cd -r 9ffe8881f856 Sources/DicomScpCallbacks.cpp --- a/Sources/DicomScpCallbacks.cpp Wed Aug 30 10:24:46 2023 +0200 +++ b/Sources/DicomScpCallbacks.cpp Wed Aug 30 10:32:26 2023 +0200 @@ -295,47 +295,47 @@ { PythonString tmp(lock, level); - PyDict_SetItemString(kw.GetPyObject(), "Level", tmp.Release()); + PyDict_SetItemString(kw.GetPyObject(), "Level", tmp.GetPyObject()); } { PythonString tmp(lock, patientId_); - PyDict_SetItemString(kw.GetPyObject(), "PatientID", tmp.Release()); + PyDict_SetItemString(kw.GetPyObject(), "PatientID", tmp.GetPyObject()); } { PythonString tmp(lock, accessionNumber_); - PyDict_SetItemString(kw.GetPyObject(), "AccessionNumber", tmp.Release()); + PyDict_SetItemString(kw.GetPyObject(), "AccessionNumber", tmp.GetPyObject()); } { PythonString tmp(lock, studyInstanceUid_); - PyDict_SetItemString(kw.GetPyObject(), "StudyInstanceUID", tmp.Release()); + PyDict_SetItemString(kw.GetPyObject(), "StudyInstanceUID", tmp.GetPyObject()); } { PythonString tmp(lock, seriesInstanceUid_); - PyDict_SetItemString(kw.GetPyObject(), "SeriesInstanceUID", tmp.Release()); + PyDict_SetItemString(kw.GetPyObject(), "SeriesInstanceUID", tmp.GetPyObject()); } { PythonString tmp(lock, sopInstanceUid_); - PyDict_SetItemString(kw.GetPyObject(), "SOPInstanceUID", tmp.Release()); + PyDict_SetItemString(kw.GetPyObject(), "SOPInstanceUID", tmp.GetPyObject()); } { PythonString tmp(lock, originatorAet_); - PyDict_SetItemString(kw.GetPyObject(), "OriginatorAET", tmp.Release()); + PyDict_SetItemString(kw.GetPyObject(), "OriginatorAET", tmp.GetPyObject()); } { PythonString tmp(lock, sourceAet_); - PyDict_SetItemString(kw.GetPyObject(), "SourceAET", tmp.Release()); + PyDict_SetItemString(kw.GetPyObject(), "SourceAET", tmp.GetPyObject()); } { PythonString tmp(lock, targetAet_); - PyDict_SetItemString(kw.GetPyObject(), "TargetAET", tmp.Release()); + PyDict_SetItemString(kw.GetPyObject(), "TargetAET", tmp.GetPyObject()); } PyDict_SetItemString(kw.GetPyObject(), "OriginatorID", PyLong_FromUnsignedLong(originatorId_)); diff -r 262189b417cd -r 9ffe8881f856 Sources/IncomingHttpRequestFilter.cpp --- a/Sources/IncomingHttpRequestFilter.cpp Wed Aug 30 10:24:46 2023 +0200 +++ b/Sources/IncomingHttpRequestFilter.cpp Wed Aug 30 10:32:26 2023 +0200 @@ -55,7 +55,7 @@ { PythonString str(lock, ip); - PyDict_SetItemString(kw.GetPyObject(), "ip", str.Release()); + PyDict_SetItemString(kw.GetPyObject(), "ip", str.GetPyObject()); } { @@ -64,10 +64,10 @@ for (uint32_t i = 0; i < headersCount; i++) { PythonString str(lock, headersValues[i]); - PyDict_SetItemString(headers.GetPyObject(), headersKeys[i], str.Release()); + PyDict_SetItemString(headers.GetPyObject(), headersKeys[i], str.GetPyObject()); } - PyDict_SetItemString(kw.GetPyObject(), "headers", headers.Release()); + PyDict_SetItemString(kw.GetPyObject(), "headers", headers.GetPyObject()); } if (method == OrthancPluginHttpMethod_Get) @@ -77,10 +77,10 @@ for (uint32_t i = 0; i < getArgumentsCount; i++) { PythonString str(lock, getArgumentsValues[i]); - PyDict_SetItemString(getArguments.GetPyObject(), getArgumentsKeys[i], str.Release()); + PyDict_SetItemString(getArguments.GetPyObject(), getArgumentsKeys[i], str.GetPyObject()); } - PyDict_SetItemString(kw.GetPyObject(), "get", getArguments.Release()); + PyDict_SetItemString(kw.GetPyObject(), "get", getArguments.GetPyObject()); } PythonObject result(lock, PyObject_Call(incomingHttpRequestFilter_, diff -r 262189b417cd -r 9ffe8881f856 Sources/RestCallbacks.cpp --- a/Sources/RestCallbacks.cpp Wed Aug 30 10:24:46 2023 +0200 +++ b/Sources/RestCallbacks.cpp Wed Aug 30 10:32:26 2023 +0200 @@ -128,7 +128,7 @@ { PythonString tmp(lock, method); - PyDict_SetItemString(kw.GetPyObject(), "method", tmp.Release()); + PyDict_SetItemString(kw.GetPyObject(), "method", tmp.GetPyObject()); } { @@ -140,7 +140,7 @@ PyTuple_SetItem(groups.GetPyObject(), i, tmp.Release()); } - PyDict_SetItemString(kw.GetPyObject(), "groups", groups.Release()); + PyDict_SetItemString(kw.GetPyObject(), "groups", groups.GetPyObject()); } if (request->method == OrthancPluginHttpMethod_Get) @@ -150,10 +150,10 @@ for (uint32_t i = 0; i < request->getCount; i++) { PythonString value(lock, request->getValues[i]); - PyDict_SetItemString(get.GetPyObject(), request->getKeys[i], value.Release()); + PyDict_SetItemString(get.GetPyObject(), request->getKeys[i], value.GetPyObject()); } - PyDict_SetItemString(kw.GetPyObject(), "get", get.Release()); + PyDict_SetItemString(kw.GetPyObject(), "get", get.GetPyObject()); } { @@ -162,10 +162,10 @@ for (uint32_t i = 0; i < request->headersCount; i++) { PythonString value(lock, request->headersValues[i]); - PyDict_SetItemString(headers.GetPyObject(), request->headersKeys[i], value.Release()); + PyDict_SetItemString(headers.GetPyObject(), request->headersKeys[i], value.GetPyObject()); } - PyDict_SetItemString(kw.GetPyObject(), "headers", headers.Release()); + PyDict_SetItemString(kw.GetPyObject(), "headers", headers.GetPyObject()); } if (request->method == OrthancPluginHttpMethod_Post ||