Search code examples
pythoncherrypy

Cherrypy server does not accept incoming http request on MS Windows if output (stdout) is not redirected


It is a rather strange 'bug'.

I have written a cherrypy based server. If I run it this way:

python simple_server.py > out.txt

It works as expected.

Without the the redirection at the end, however, the server will not accept any connection at all.

Anyone has any idea?

I am using python 2.4 on a Win XP professional machine.


Solution

  • Are you running the script in an XP "command window"? Otherwise (if there's neither redirection nor command window available), standard output might simply be closed, which might inhibit the script (or rather its underlying framework).