Grisha wrote ..
> 
> On Thu, 3 Nov 2005, Graham Dumpleton wrote:
> 
> > With the thought of mod_python perhaps ignoring the PythonEnabledPdb
> > option when not run in single process mode, is there a way using the
> > apache.mpm_query() function or some other function of determining that
> > Apache is running in single process mode?
> 
> I wonder if simply examining sys.argv would work?

Can't be done this way as sys.argv doesn't even exist in mod_python.
This has come up a few times as a problem recently because of third
party modules expecting to get options direct from sys.argv. One
such thread was:

  http://www.modpython.org/pipermail/mod_python/2005-September/019053.html

My suggestion at the time was that mod_python should set sys.argv
to the dummy value of ['mod_python']. This could be done in the
apache.init() method. I'll log this as a possible improvment in JIRA
as I am probably about to log some other issues anyway.

Anyway, back to pdb, I recollect that the Apache command line
arguments are available in some way, just haven't had a chance to
go looking yet. Think it is possible one of the environment variables
or something has it.

Also need to sort out how -DONE_PROCESS and -X options are
different, as pdb support also works if -X option is used. This is
probably dangerous though to use as you still potentially get
child processes and thus fire off more than one request and they
will fight over standard input.

More later.

Graham

Reply via email to