Diez B. Roggisch wrote:

Is there some reasonable explanation for this behaviour? Thanks in
advance.

I can only guess that SCGIServer does something to stdout. Your code isn't
executed twice, so the doubling seems to come from writing it twice.

Yes I know that code isn't executed twice since the value of n remains the same, only print lines are doubled.

Try e.g. redirecting stdout and stderr to different files, and see if things
appear once in both.

Redirection of stdout:

e...@sunce:~/data/project/ScgiServer/test> python test.py 1> output.txt
^ce...@sunce:~/data/project/ScgiServer/test> cat output.txt
Starting server.
Exception!
Terminating server, attempt 1.
Check n: 2.
Starting server.
Exception!
Terminating server, attempt 1.
Check n: 2.

Redirecting stderr creates an empty file. I still haven't found the solution.

--
www.vikendi.net -/- www.supergrupa.com
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to