SimpleXMLRPCServer clobbering sys.stderr? (2.5.2)
gagsl-py2 at yahoo.com.ar
Tue Oct 20 23:44:32 CEST 2009
En Mon, 19 Oct 2009 00:09:10 -0300, Joseph Turian <turian at gmail.com>
>> > I was having a mysterious problem with SimpleXMLRPCServer. (I am using
>> > Python 2.5.2)
>> > The request handlers were sometimes failing without any error message
>> > to the log output.
> Here's what I see:
> * If I use logging to write the output, I don't see any output in the
> server log, but the client gets correct results.
> * If I use sys.stderr to write the output, I don't see any output in
> the server log AND the client gets INcorrect results.
> * If I use sys.stdout to write the output, I DO see any output in the
> server log AND the client gets correct results.
> Why does only sys.stdout work within XMLRPCServer registered methods?
I'm afraid I'm out of ideas. Inside SimpleXMLRPCServer.py there is no
reference to 'stderr', and stdout only appears in the CGI handler.
BaseHTTPServer.py writes to sys.stderr in log_message(). SocketServer.py
may write to both sys.stderr and sys.stdout when an error is encountered
(in the handle_error method). But none of them alters nor reassigns
sys.stdout/sys.stderr; all output should go to the console from which you
started the server, unless you redirect it from the command line (or your
main program redirects it by code or does something strange with those
More information about the Python-list