Eddie Diener
eddielee at tropicsoft.com
Mon May 10 21:23:15 EST 2004
Gregory (Grisha) Trubetskoy wrote: > I'm not sure I see any "serious bug" here just yet, but it would > certainly help to know what your Apache configuration is, as well as > versions of Python, mod_python, Apache and the OS. :-) As far as serious bug is concerned, does it look from the code below that "from mod_python import psp" should fail for any reason that you can see ? I don't say that it has to be a mod_python bug, but just that the failure should not occur given the files I presented unless there is some limitation or other I don't understand. The Apache version is 2.0.48. The mod_python version is 3.1.3.0. The OS is WinXP. The version of Python is 2.3 . The .htaccess file in the rx directory has what is recommended in your FAQ for multiple handlers in the same directory. AddHandler mod_python .py .psp PythonHandler mod_python.publisher | .py PythonHandler mod_python.psp | .psp PythonDebug On Were you able to duplicate this situation and the bug ? I am at home now and this occurred at work during the day where I am using mod_python to program web applications for a company. It's been a good tool, but this was a showstopper since I have a PSP page with a rxreport.py file as the form handler. I did not show the entire page as this minimum example was enough to create the bug, but the actual PSP page has PSP code like <%= rxreport.ErrorMessage() %> on it, which is why I needed to do: <% import rxreport %> at the top of my PSP page. > > Thanks, > > Grisha > > On Mon, 10 May 2004, Diener, Edward wrote: > >> The PSP page, rx/rx.psp, is: >> >> <% >> import rxreport >> %> >> <html> >> <body> >> <form action="/rx/rxreport.py/HandleLogin" method="post"> >> <input type="text" >> name="user" size="23"> >> <input type="password" >> name="pword" size="23"> >> <input >> type="submit" value="Submit"></form> >> Hello >> </body> >> </html> >> >> The handler, rx/rxreport.py, is: >> >> from mod_python import apache >> from mod_python import psp >> def HandleLogin(req,user = "",pword = ""): >> if user == "": >> tmpl = psp.PSP(req,filename = "rx.psp") >> tmpl.run() >> return "NO" >> return "YES" >> >> Attempting to open http://localhost:8090/rx/rx.psp gives: >> >> 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/rx/rx.psp", line >> 2, in ? >> import rxreport >> >> File "C:/Program Files/Apache Group/Apache2/htdocs/rx/\rxreport.py", >> line 2, in ? >> from mod_python import psp >> >> ImportError: cannot import name psp >> >> > _______________________________________________ > Mod_python mailing list > Mod_python at modpython.org > http://mailman.modpython.org/mailman/listinfo/mod_python
|