# HG changeset patch # User Jean-Francois Pieronne <jf.pieronne@laposte.net> # Date 1598254456 -34200 # Mon Aug 24 17:04:16 2020 +0930 # Node ID 90398408928b6eacc849c0c2570a22884c141003 # Parent 79a6d8efb363fb653276fe275d68dc4d388a0617 v1.1.4 update diff --git a/src/python/build_pyrte.com b/src/python/build_pyrte.com --- a/src/python/build_pyrte.com +++ b/src/python/build_pyrte.com @@ -10,7 +10,7 @@ $! VERSION HISTORY $! --------------- $! -$ IMAGE_IDENT = "PYRTE113" +$ IMAGE_IDENT = "PYRTE114" $! $! 22-APR-2007 JFP use same build options as Python $! 10-APR-2007 MGD initial diff --git a/src/python/pyrte.c b/src/python/pyrte.c --- a/src/python/pyrte.c +++ b/src/python/pyrte.c @@ -271,6 +271,7 @@ VERSION HISTORY (update SOFTWAREVN as well!) --------------- +08-DEC-2009 JFP v1.1.4, fix bugs introduced in 1.1.3 07-DEC-2009 JFP v1.1.3, os.environ is not a dictionary on OpenVMS 19-APR-2008 JFP v1.1.2, WSGI buffered output (see description above) 17-JAN-2008 MGD v1.1.1, CgiVar() and CgiVarDclSymbol() ensure an empty @@ -281,7 +282,7 @@ /*****************************************************************************/ #define SOFTWARECR "Copyright (C) 2007-2009 Mark G.Daniel" -#define SOFTWAREVN "1.1.3" +#define SOFTWAREVN "1.1.4" #define SOFTWARENM "PYRTE" #ifdef __ALPHA # define SOFTWAREID SOFTWARENM " AXP-" SOFTWAREVN @@ -1596,11 +1597,12 @@ key = PyString_AsString(pKey); pValue = PyMapping_GetItemString(pOsEnvironDict, key); retval = PyMapping_SetItemString(pEnvironDict, key, pValue); - if (retval = -1) + if (retval == -1) { ReportError (__LINE__, 0, 1, ErrorCgiVarEnv); return (0); } + Py_DECREF(pValue); } } Py_DECREF(pKeys); @@ -1629,18 +1631,29 @@ *sptr = '\0'; pValue = PyString_FromString (sptr+1); retval = PyMapping_SetItemString (pEnvironDict, cptr, pValue); + if (retval == -1) + { + ReportError (__LINE__, 0, 1, ErrorCgiVarEnv); + return (0); + } Py_DECREF (pValue); *sptr = '='; } DEBUGPYOBJ("pEnvironDict",pEnvironDict) retval = PyDict_SetItemString (pOsDict, "environ", pEnvironDict); + if (retval == -1) + { + ReportError (__LINE__, 0, 1, ErrorCgiVarEnv); + return (0); + } if (Debug) fprintf (stdout, "PyMapping_SetItemString() %d\n", retval); } else { DEBUGPYOBJ("1pEnvironDict",pEnvironDict) - PyObject_CallMethod(pOsEnvironDict, "clear", "()"); + pValue = PyObject_CallMethod(pEnvironDict, "clear", "()"); + Py_DECREF (pValue); DEBUGPYOBJ("2pEnvironDict",pEnvironDict) }