You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-commits@quetz.apache.org by gr...@apache.org on 2006/07/30 06:22:23 UTC
svn commit: r426865 - in /httpd/mod_python/trunk: Doc/appendixc.tex
Doc/modpython4.tex lib/python/mod_python/__init__.py
lib/python/mod_python/psp.py src/include/mpversion.h
Author: grahamd
Date: Sat Jul 29 21:22:17 2006
New Revision: 426865
URL: http://svn.apache.org/viewvc?rev=426865&view=rev
Log:
MODPYTHON-38) Fixed issue when using PSP pages in conjunction with
publisher handler or where a PSP error page was being triggered, that form
parameters coming from content of a POST request weren't available or only
available using a workaround. Specifically, the PSP page will now use any
FieldStorage object instance cached as req.form left there by preceding
code.
Modified:
httpd/mod_python/trunk/Doc/appendixc.tex
httpd/mod_python/trunk/Doc/modpython4.tex
httpd/mod_python/trunk/lib/python/mod_python/__init__.py
httpd/mod_python/trunk/lib/python/mod_python/psp.py
httpd/mod_python/trunk/src/include/mpversion.h
Modified: httpd/mod_python/trunk/Doc/appendixc.tex
URL: http://svn.apache.org/viewvc/httpd/mod_python/trunk/Doc/appendixc.tex?rev=426865&r1=426864&r2=426865&view=diff
==============================================================================
--- httpd/mod_python/trunk/Doc/appendixc.tex (original)
+++ httpd/mod_python/trunk/Doc/appendixc.tex Sat Jul 29 21:22:17 2006
@@ -359,6 +359,14 @@
inherited from the caller meaning caller could no longer use it safely.
PSP code will now only unlock session if it created it in the first
place.
+ \item
+ (\citetitle[http://issues.apache.org/jira/browse/MODPYTHON-38]{MODPYTHON-38})
+ Fixed issue when using PSP pages in conjunction with publisher handler
+ or where a PSP error page was being triggered, that form parameters
+ coming from content of a POST request weren't available or only available
+ using a workaround. Specifically, the PSP page will now use any
+ \code{FieldStorage} object instance cached as \code{req.form} left
+ there by preceding code.
\end{itemize}
\chapter{Changes from Version (3.2.7)\label{app-changes-from-3.2.7}}
Modified: httpd/mod_python/trunk/Doc/modpython4.tex
URL: http://svn.apache.org/viewvc/httpd/mod_python/trunk/Doc/modpython4.tex?rev=426865&r1=426864&r2=426865&view=diff
==============================================================================
--- httpd/mod_python/trunk/Doc/modpython4.tex (original)
+++ httpd/mod_python/trunk/Doc/modpython4.tex Sat Jul 29 21:22:17 2006
@@ -2728,7 +2728,7 @@
referenced in the code.
The object passed in \code{psp} is an instance of
- \class{PSPInstance}.
+ \class{PSPInterface}.
\end{methoddesc}
@@ -2760,12 +2760,12 @@
\end{classdesc}
-\begin{classdesc}{PSPInstance}{}
+\begin{classdesc}{PSPInterface}{}
An object of this class is passed as a global variable \code{psp} to
the PSP code. Objects of this class are instantiated internally and
the interface to \method{__init__} is purposely undocumented.
- \begin{methoddesc}[PSPInstance]{set_error_page}{filename}
+ \begin{methoddesc}[PSPInterface]{set_error_page}{filename}
Used to set a psp page to be processed when an exception
occurs. If the path is absolute, it will be appended to document
root, otherwise the file is assumed to exist in the same directory
@@ -2774,12 +2774,12 @@
\code{sys.exc_info()}.
\end{methoddesc}
- \begin{methoddesc}[PSPInstance]{apply_data}{object\optional{, **kw}}
+ \begin{methoddesc}[PSPInterface]{apply_data}{object\optional{, **kw}}
This method will call the callable object \var{object}, passing form
data as keyword arguments, and return the result.
\end{methoddesc}
- \begin{methoddesc}[PSPInstance]{redirect}{location\optional{, permanent=0}}
+ \begin{methoddesc}[PSPInterface]{redirect}{location\optional{, permanent=0}}
This method will redirect the browser to location
\var{location}. If \var{permanent} is true, then
\constant{MOVED_PERMANENTLY} will be sent (as opposed to
Modified: httpd/mod_python/trunk/lib/python/mod_python/__init__.py
URL: http://svn.apache.org/viewvc/httpd/mod_python/trunk/lib/python/mod_python/__init__.py?rev=426865&r1=426864&r2=426865&view=diff
==============================================================================
--- httpd/mod_python/trunk/lib/python/mod_python/__init__.py (original)
+++ httpd/mod_python/trunk/lib/python/mod_python/__init__.py Sat Jul 29 21:22:17 2006
@@ -20,5 +20,5 @@
__all__ = ["apache", "cgihandler", "psp",
"publisher", "util", "python22"]
-version = "3.3.0-dev-20060729"
+version = "3.3.0-dev-20060730"
Modified: httpd/mod_python/trunk/lib/python/mod_python/psp.py
URL: http://svn.apache.org/viewvc/httpd/mod_python/trunk/lib/python/mod_python/psp.py?rev=426865&r1=426864&r2=426865&view=diff
==============================================================================
--- httpd/mod_python/trunk/lib/python/mod_python/psp.py (original)
+++ httpd/mod_python/trunk/lib/python/mod_python/psp.py Sat Jul 29 21:22:17 2006
@@ -75,7 +75,14 @@
def apply_data(self, object):
if not self.form:
- self.form = util.FieldStorage(self.req, keep_blank_values=1)
+ if not hasattr(self.req, 'form'):
+ # no existing form, so need to create one,
+ # form has to be saved back to request object
+ # so that error page can access it if need be
+ self.form = util.FieldStorage(self.req, keep_blank_values=1)
+ self.req.form = self.form
+ else:
+ self.form = self.req.form
return util.apply_fs_data(object, self.form, req=self.req)
@@ -199,7 +206,14 @@
# does this code use form?
form = None
if "form" in code.co_names:
- form = util.FieldStorage(req, keep_blank_values=1)
+ if not hasattr(req, 'form'):
+ # no existing form, so need to create one,
+ # form has to be saved back to request object
+ # so that error page can access it if need be
+ form = util.FieldStorage(req, keep_blank_values=1)
+ req.form = form
+ else:
+ form = req.form
# create psp interface object
psp = PSPInterface(req, self.filename, form)
Modified: httpd/mod_python/trunk/src/include/mpversion.h
URL: http://svn.apache.org/viewvc/httpd/mod_python/trunk/src/include/mpversion.h?rev=426865&r1=426864&r2=426865&view=diff
==============================================================================
--- httpd/mod_python/trunk/src/include/mpversion.h (original)
+++ httpd/mod_python/trunk/src/include/mpversion.h Sat Jul 29 21:22:17 2006
@@ -1,5 +1,5 @@
#define MPV_MAJOR 3
#define MPV_MINOR 3
#define MPV_PATCH 0
-#define MPV_BUILD 20060729
-#define MPV_STRING "3.3.0-dev-20060729"
+#define MPV_BUILD 20060730
+#define MPV_STRING "3.3.0-dev-20060730"