Title: Problem with Output Redirection and ActivePython 2.1, build 211

Hi,

this morning I hit a strange problem with ActivePython 2.1 on a Windows NT4 sp6 machine.
I did test my script with Komodo, everything o.k..
It also runs from the CMD shell.

When I redirect output as follows:

        python test_undocheckout_all.py 1>test.log 2>test.err

nothing happens, both test.log and test.err are empty.
Not possible, the same script invoked without redirection writes several lines to the output.

So I checked the python -help command line parameters and experimented with the -u parameter (unbuffered binary stdout and stderr).

And surprise, the following works as expected:

        python -u test_undocheckout_all.py 1>test.log 2>test.err


So is there a problem with buffered output?
Do I have to define the environment variable PYTHONUNBUFFERED under Windows?
I would suggest that when the python.exe process is terminated, the output buffer should be flushed, or do I have to do that explicitly in my script?


Peter
[EMAIL PROTECTED]

Reply via email to