diff --git a/src/python/build_pyrte.com b/src/python/build_pyrte.com index a7f4905f74b5b93d08300c55359ac4c1e05b3706_c3JjL3B5dGhvbi9idWlsZF9weXJ0ZS5jb20=..af3c84545f5923b971cc7ca11c7cd04bd4b0074c_c3JjL3B5dGhvbi9idWlsZF9weXJ0ZS5jb20= 100755 --- a/src/python/build_pyrte.com +++ b/src/python/build_pyrte.com @@ -1,7 +1,7 @@ $!----------------------------------------------------------------------------- $! BUILD_PYRTE.COM $! -$! Copyright (C) 2007 Mark G.Daniel. +$! Copyright (C) 2007-2009 Mark G.Daniel. $! This package (all associated programs), comes with ABSOLUTELY NO WARRANTY. $! This is free software, and you are welcome to redistribute it $! under the conditions of the GNU GENERAL PUBLIC LICENSE, version 2. @@ -10,7 +10,7 @@ $! VERSION HISTORY $! --------------- $! -$ IMAGE_IDENT = "PYRTE100" +$ IMAGE_IDENT = "PYRTE113" $! $! 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 index a7f4905f74b5b93d08300c55359ac4c1e05b3706_c3JjL3B5dGhvbi9weXJ0ZS5j..af3c84545f5923b971cc7ca11c7cd04bd4b0074c_c3JjL3B5dGhvbi9weXJ0ZS5j 100755 --- a/src/python/pyrte.c +++ b/src/python/pyrte.c @@ -187,7 +187,7 @@ PYRTE COPYRIGHT --------------- -Copyright (C) 2007,2008 Mark G.Daniel +Copyright (C) 2007-2009 Mark G.Daniel This package comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under the conditions of the GNU GENERAL PUBLIC LICENSE, version 3, or any later version. @@ -271,6 +271,7 @@ VERSION HISTORY (update SOFTWAREVN as well!) --------------- +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 SCRIPT_NAME *is* empty (not the WASD-ism "/") @@ -279,8 +280,8 @@ */ /*****************************************************************************/ -#define SOFTWARECR "Copyright (C) 2007,2008 Mark G.Daniel" -#define SOFTWAREVN "1.1.2" +#define SOFTWARECR "Copyright (C) 2007-2009 Mark G.Daniel" +#define SOFTWAREVN "1.1.3" #define SOFTWARENM "PYRTE" #ifdef __ALPHA # define SOFTWAREID SOFTWARENM " AXP-" SOFTWAREVN @@ -1552,7 +1553,8 @@ int retval; char *cptr, *sptr, *NamePtr; - PyObject *pValue; + PyObject *pValue, *pKey, *pKeys; + Py_ssize_t pKenLen; /*********/ /* begin */ @@ -1578,5 +1580,5 @@ if (!pEnvironDict) { /* new reference */ - pEnvironDict = PyDict_New (); + pEnvironDict = PyObject_CallMethod(pOsEnvironDict, "copy", "()"); } @@ -1582,10 +1584,26 @@ } - - retval = PyDict_Merge (pEnvironDict, pOsEnvironDict, 0); - if (retval) - { - ReportError (__LINE__, 0, 1, ErrorCgiVarEnv); - return (0); + else + { + /* Restore missing environ variables */ + pKeys = PyMapping_Keys(pOsEnvironDict); + pKenLen = PyList_Size(pKeys); + for (int i = 0; i < pKenLen; ++i) + { + pKey = PyList_GetItem(pKeys, i); + if (! PyMapping_HasKey(pEnvironDict, pKey)) + { + char *key; + key = PyString_AsString(pKey); + pValue = PyMapping_GetItemString(pOsEnvironDict, key); + retval = PyMapping_SetItemString(pEnvironDict, key, pValue); + if (retval = -1) + { + ReportError (__LINE__, 0, 1, ErrorCgiVarEnv); + return (0); + } + } + } + Py_DECREF(pKeys); } DEBUGPYOBJ("pEnvironDict",pEnvironDict) @@ -1610,7 +1628,7 @@ if (!*sptr) continue; *sptr = '\0'; pValue = PyString_FromString (sptr+1); - retval = PyDict_SetItemString (pEnvironDict, cptr, pValue); + retval = PyMapping_SetItemString (pEnvironDict, cptr, pValue); Py_DECREF (pValue); *sptr = '='; } @@ -1622,7 +1640,7 @@ else { DEBUGPYOBJ("1pEnvironDict",pEnvironDict) - PyDict_Clear (pEnvironDict); + PyObject_CallMethod(pOsEnvironDict, "clear", "()"); DEBUGPYOBJ("2pEnvironDict",pEnvironDict) } diff --git a/src/python/readme.txt b/src/python/readme.txt index a7f4905f74b5b93d08300c55359ac4c1e05b3706_c3JjL3B5dGhvbi9yZWFkbWUudHh0..af3c84545f5923b971cc7ca11c7cd04bd4b0074c_c3JjL3B5dGhvbi9yZWFkbWUudHh0 100755 --- a/src/python/readme.txt +++ b/src/python/readme.txt @@ -4,7 +4,7 @@ PYRTE COPYRIGHT --------------- -Copyright (C) 2007,2008 Mark G.Daniel +Copyright (C) 2007-2009 Mark G.Daniel This package comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under the conditions of the GNU GENERAL PUBLIC LICENSE, version 3, or any later version. diff --git a/src/python/readmore.html b/src/python/readmore.html index a7f4905f74b5b93d08300c55359ac4c1e05b3706_c3JjL3B5dGhvbi9yZWFkbW9yZS5odG1s..af3c84545f5923b971cc7ca11c7cd04bd4b0074c_c3JjL3B5dGhvbi9yZWFkbW9yZS5odG1s 100755 --- a/src/python/readmore.html +++ b/src/python/readmore.html @@ -60,5 +60,5 @@ <CENTER> <H1>Python Run-Time Environment</H1> -<H3>Version 1.1.2, 19th April 2008</H3> +<H3>Version 1.1.3, 7th Decmeber 2009</H3> @@ -64,5 +64,5 @@ -<P><B>Copyright © 2007,2008 Mark G. Daniel</B> +<P><B>Copyright © 2007-2009 Mark G. Daniel</B> <BR>This program, comes with ABSOLUTELY NO WARRANTY. <BR>This is free software, and you are welcome to redistribute it under the <BR>conditions of the GNU GENERAL PUBLIC LICENSE, version 3, or any later version.