[mod_python] Problem doing PSP redirect

Diener, Edward Edward.Diener at loyaltyworks.com
Thu May 20 15:42:27 EDT 2004


You are correct. It is actually a form value, which is a StringField. I
really fell asleep on this one.


-----Original Message-----
From: Volodya [mailto:volodya at real.samuraj.org] 
Sent: Thursday, May 20, 2004 2:37 PM
To: Diener, Edward
Subject: Re: [mod_python] Problem doing PSP redirect


On Thu, May 20, 2004 at 02:05:40PM -0400, Diener, Edward wrote:
> In the code of my PSP page a do a psp.redirect(somestringvalue) and I 
> receive this trace:
>  
> Mod_python error: "PythonHandler mod_python.psp"
> 
> Traceback (most recent call last):
> 
>   File "C:\Utilities\Python23\Lib\site-packages\mod_python\apache.py",
> line 299, in HandlerDispatch
>     result = object(req)
> 
>   File "C:\Utilities\Python23\Lib\site-packages\mod_python\psp.py", 
> line 297, in handler
>     p.run()
> 
>   File "C:\Utilities\Python23\Lib\site-packages\mod_python\psp.py", 
> line 208, in run
>     exec code in global_scope
> 
>   File "C:/Program Files/Apache 
> Group/Apache2/htdocs/RegistrationTwo/RegistrationPageUpdate.psp", line

> 21, in ?
>     psp.redirect(req.url)
> 
>   File "C:\Utilities\Python23\Lib\site-packages\mod_python\psp.py", 
> line 84, in redirect
>     util.redirect(self.req, location, permanent)
> 
>   File "C:\Utilities\Python23\Lib\site-packages\mod_python\util.py",
> line 371, in redirect
>     req.err_headers_out["Location"] = location
> 
> TypeError: table values must be strings
>  
> The value which I am passing as the redirect URL (req.url) is a 
> string. I even print it to a log and it is a totally valid URL 
> address. Why am I getting this error ?

Double check that this string is string in fact. Best way is to print
its type:

req.write("Type is: %s" % type(somestring))




More information about the Mod_python mailing list