Created: (MODPYTHON-90) Explicitly don't allow Pdb support to work if not ONE_PROCESS
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Mod-Python > Created: (MODPYTHON-90) Explicitly don't allow Pdb support to work if not ONE_PROCESS




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Created: (MODPYTHON-90) Explicitly don't allow Pdb support to work if not ONE_PROCESS  
Graham Dumpleton (JIRA)


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-11-05 07:46 AM

Explicitly don't allow Pdb support to work if not ONE_PROCESS mode.
-------------------------------------------------------------------

Key: MODPYTHON-90
URL: http://issues.apache.org/jira/browse/MODPYTHON-90
Project: mod_python
Type: Improvement
Components: core
Versions: 3.3
Reporter: Graham Dumpleton
Priority: Minor


mod_python provides the PythonEnablePdb option for enabling of the Python de
bugger. For it to work properly though, it is necessary to start httpd from 
the command line with the -DONE_PROCESS option. If one doesn't do this thoug
h and enables PythonEnableP
db when Apache is running normally, any request to a URL for which the debug
ger is enabled will yield a 500 error. The details of the 500 error will be:

Mod_python error: "PythonHandler mptest"

Traceback (most recent call last):

File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3
/site-packages/mod_python/apache.py", line 313, in HandlerDispatch
assert (type(result) == type(int())), \

AssertionError: Handler 'mptest' returned invalid return code.

This error message isn't particularly helpful in understanding that the prob
lem is that the debugger can't be run in this mode.

To avoid this problem at the moment, all that can be done is for the user to
 know that their Apache configuration should actually say:

<IfDefine ONE_PROCESS>
PythonEnablePdb On
</IfDefine>

This would mean they could leave the Apache configuration set the one way an
d not have to worry.

What could instead be done in mod_python though is simply to ignore the Pyth
onEnablePdb option and that it is set if Apache hasn't been run in ONE_PROCE
SS mode. Thus, presuming that MODPYTHON-89 has been implemented, the mod_pyt
hon code in mod_python.apac
he in the number of places where it occurs, could say:

# call the object
if exists_config_define("ONE_PROCESS") and config.has_key("PythonEnablePdb")
:
result = pdb.runcall(object, conn)
else:
result = object(conn)








[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:03 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register