From eric.engle at mac.com Sat Mar 1 05:27:59 2014 From: eric.engle at mac.com (Eric Engle) Date: Sat, 01 Mar 2014 00:27:59 -0500 Subject: [mod_python] Issue in configure for mod_python 3.5.0 Message-ID: To all mod_python users, It seems that there is a dependency on git for the mod_python install to work correctly. In the install package, in dist/, there is a shell script version.sh. In the script, a git --always command is issued. See below: #!/bin/sh MPV_PATH="`dirname $0`/../src/include/mp_version.h" MAJ=`awk '/MP_VERSION_MAJOR/ {print $3}' $MPV_PATH` MIN=`awk '/MP_VERSION_MINOR/ {print $3}' $MPV_PATH` PCH=`awk '/MP_VERSION_PATCH/ {print $3}' $MPV_PATH` GIT=`git describe --always` echo $MAJ.$MIN.$PCH-$GIT If git is not installed on your system (maybe it should, but current install docs do not state it is a dependency), then version.sh will inserted junk into a variable version in version.py that is generated as a result of make. A check in the script for git would be very helpful down the road. #!/bin/sh MPV_PATH="`dirname $0`/../src/include/mp_version.h" MAJ=`awk '/MP_VERSION_MAJOR/ {print $3}' $MPV_PATH` MIN=`awk '/MP_VERSION_MINOR/ {print $3}' $MPV_PATH` PCH=`awk '/MP_VERSION_PATCH/ {print $3}' $MPV_PATH` GIT=`git describe --always` if git ?version &>/dev/null; then echo $MAJ.$MIN.$PCH-$GIT else echo $MAJ.$MIN.$PCH fi Once I corrected the version number string in version.py, mod_python is working as expected. Thanks, Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From grisha at modpython.org Sat Mar 1 17:58:57 2014 From: grisha at modpython.org (Grisha Trubetskoy) Date: Sat, 1 Mar 2014 12:58:57 -0500 Subject: [mod_python] Issue in configure for mod_python 3.5.0 In-Reply-To: References: Message-ID: Eric This will be resolved in the next version, here is the git issue: https://github.com/grisha/mod_python/issues/20 Regards, Grisha On Sat, Mar 1, 2014 at 12:27 AM, Eric Engle wrote: > To all mod_python users, > > It seems that there is a dependency on git for the mod_python install to > work correctly. In the install package, in dist/, there is a shell script > version.sh. In the script, a git --always command is issued. See below: > > #!/bin/sh > > MPV_PATH="`dirname $0`/../src/include/mp_version.h" > > MAJ=`awk '/MP_VERSION_MAJOR/ {print $3}' $MPV_PATH` > MIN=`awk '/MP_VERSION_MINOR/ {print $3}' $MPV_PATH` > PCH=`awk '/MP_VERSION_PATCH/ {print $3}' $MPV_PATH` > GIT=`git describe --always` > > echo $MAJ.$MIN.$PCH-$GIT > > If git is not installed on your system (maybe it should, but current install > docs do not state it is a dependency), then version.sh will inserted junk > into a variable version in version.py that is generated as a result of make. > > A check in the script for git would be very helpful down the road. > > #!/bin/sh > > MPV_PATH="`dirname $0`/../src/include/mp_version.h" > > MAJ=`awk '/MP_VERSION_MAJOR/ {print $3}' $MPV_PATH` > MIN=`awk '/MP_VERSION_MINOR/ {print $3}' $MPV_PATH` > PCH=`awk '/MP_VERSION_PATCH/ {print $3}' $MPV_PATH` > GIT=`git describe --always` > > if git --version &>/dev/null; then > echo $MAJ.$MIN.$PCH-$GIT > else > echo $MAJ.$MIN.$PCH > fi > > Once I corrected the version number string in version.py, mod_python is > working as expected. > > Thanks, > Eric > > > > _______________________________________________ > mod_python mailing list > mod_python at modpython.org > http://mailman.modpython.org/mailman/listinfo/mod_python > From rgomes at consumer.org Tue Mar 4 15:11:51 2014 From: rgomes at consumer.org (Ron Gomes) Date: Tue, 4 Mar 2014 10:11:51 -0500 (EST) Subject: [mod_python] Change request: "allow req.args = None" Message-ID: We use mod_python to rewrite URLs internally based on request criteria. As part of our processing, in our request handler we grab and then remove any request query parameters by setting req.args = None so that they will be invisible to later phases. A change was necessary to src/requestobject.c in order to make this work since, as delivered, that line causes an exception to be thrown because the code only allows Python strings to be assigned to req.args. =========================================== $ diff -c src/requestobject.c.ORIG src/requestobject.c *** src/requestobject.c.ORIG 2013-11-11 22:21:34.000000000 -0500 --- src/requestobject.c 2014-02-18 15:36:14.401921415 -0500 *************** *** 1967,1972 **** --- 1967,1977 ---- return 0; } else if (strcmp(name, "args") == 0) { + if (val == Py_None) { + self->request_rec->args = 0; + return 0; + } + MP_ANYSTR_AS_STR(v, val, 1); if (!v) { Py_DECREF(val); /* MP_ANYSTR_AS_STR */ =========================================== Assigning an empty string would work but the semantics of that are slightly different and are indistinguishable from an explictly-empty query string. Can this be incorporated into mod_python, so that we don't have to retrofit this change into every new version?