|
Graham Dumpleton
graham.dumpleton at gmail.com
Tue Mar 31 07:42:43 EDT 2009
Enable the PSP code debugging feature I asked you to. Documentation mentions it at: http://www.modpython.org/live/current/doc-html/hand-psp.html In other words, you want to enable .psp_ requests to get side by side comparison of PSP code and generated Python code. Graham 2009/3/31 <rahul.warhekar at edisphere.com>: > hi graham > > I just got entire trace please have a look at it > > Mod_python error: "PythonHandler mod_python.psp" > > Traceback (most recent call last): > > File "C:\Python24\lib\site-packages\mod_python\apache.py", line 299, in > HandlerDispatch > result = object(req) > > File "C:\Python24\lib\site-packages\mod_python\psp.py", line 302, in > handler > p.run() > > File "C:\Python24\lib\site-packages\mod_python\psp.py", line 213, in run > exec code in global_scope > > File "C:/wamp/www/edi/modules/reports/index.psp", line 43, in ? > > WindowsError: [Errno 2] The system cannot find the file specified > > > > my index.psp contents are, > > > <% > import os > from mod_python import Session > from mod_python import util > from mod_python import psp > _REQUEST = util.FieldStorage(req) > view = "reports" > user ='' > session.load() > try: > user = session['user'] > user_name = session['user'] > except KeyError,e: > util.redirect(req,"/edi/login.psp") > try: > new=session['my_filter'] > except KeyError,e: > util.redirect(req,"/edi/login.psp") > > > if view=='reports': > util.redirect(req,'/edi/modules/reports/index.psp?hidval=f&showcnt=25&user=%s'%session['user']) > else: > req.write("Invalid User") > > %> > > > I have nothing on my line no 43. > > Rahul > >> 2009/3/31 <rahul.warhekar at edisphere.com>: >>> Traceback is:- >>> >>> Mod_python error: "PythonHandler mod_python.psp" >>> >>> File C:/wamp/www/edi/modules/reports/index.psp in line no 43 >>> WindowsError: [Errno 2] The system cannot find the file specified >>> >>> I have this much traceback only with me. Any idea depending on this. >> >> The only remaining suggestion I have then is to check that the user >> that the Apache service runs as has the necessary privileges to access >> the directories/files that make up your project. >> >> Also calculate exactly what line 43 is in the file. I don't believe >> you have identified this to us. If there is no line 43, then it is >> possibly identifying the line in the generate Python code for the PSP >> page. In that case, enable PSP debug mode using: >> >> AddHandler mod_python .psp_ >> PythonHandler mod_python.psp | .psp_ >> >> and access URL 'index.psp_'. >> >> Check manual on how to do this, as my memory on how to do that is really >> bad. >> >> Graham >> >>>>> util.redirect(req,"modules/reports/index.psp?hidval=f&showcnt=25&user=%s"%se >>>>> ssion['user']) >>> >>> i have made it as >>> >>> util.redirect(req,"http://localhost/edi/modules/reports/index.psp?hidval=f&showcnt=25&user=%s"%se >>> ssion['user']) >>> >>> Still not working >>> >>> Rahul >>> >>> >>>> 2009/3/31 rahul <rahul.warhekar at edisphere.com>: >>>>> Hi graham, >>>>> >>>>> I have done what you suggested but was not successful. >>>>> My code in index.psp is >>>>> >>>>> >>>>> <% >>>>> import os >>>>> from mod_python import Session >>>>> from mod_python import util >>>>> from mod_python import psp >>>>> _REQUEST = util.FieldStorage(req) >>>>> view = "reports" >>>>> user ='' >>>>> session.load() >>>>> >>>>> if view=='reports': >>>>> >>>>> util.redirect(req,"modules/reports/index.psp?hidval=f&showcnt=25&user=%s"%se >>>>> ssion['user']) >>>> >>>> This isn't what I told you to use. >>>> >>>> Having a path that doesn't start with a '/' will not ever work either. >>>> >>>>> else: >>>>> req.write("Invalid User") >>>>> >>>>> %> >>>>> >>>>> And full error message is >>>> >>>> That is not the full message. >>>> >>>> Post the complete Python traceback giving lines numbers, files etc. >>>> >>>> Graham >>>> >>>>> Mod_python Error: mod python stuff >>>>> And in last it gives >>>>> >>>>> File C:/wamp/www/edi/modules/reports/index.psp >>>>> WindowsError [Errno2]: The system cannot find the file specified. >>>>> >>>>> >>>>> According to me it seems that my mod_python code is not getting >>>>> executed >>>>> or >>>>> either it is not registered. >>>>> >>>>> Any suggestion on this will be greatly appreciated. >>>>> >>>>> Thanks, >>>>> >>>>> |