Author rgpitts
Recipients rgpitts
Date 2010-08-04.07:34:12
SpamBayes Score 8.65377e-09
Marked as misclassified No
Message-id <>
OS: Windows 2003 Server R2 x64 Standard Edition
Python: 2.6.5
MSVC: 9.0
Application Description: Windows service calling Python C API to run algorithm written in Python.

I've been encountering a random application hang when calling the Python C API function PyObject_CallMethod to call a function on a class instance. I've discovered that the C function fwrite in string_print in stringobject.c is blocking after being called multiple times due to print statements in Python code. My application as a Windows service does not have a stdout and fwrite is buffering data before attempting to write it to a non-existent stdout, thus blocking and hanging the service. This isn't an issue when the application has a console window because stdout is available.

We are in the process changing the print statements to write to file. Ideally a Python exception needs raising if print cannot write to stdout.
Date User Action Args
2010-08-04 07:34:16rgpittssetrecipients: + rgpitts
2010-08-04 07:34:16rgpittssetmessageid: <>
2010-08-04 07:34:13rgpittslinkissue9503 messages
2010-08-04 07:34:12rgpittscreate