[pywin32-bugs] [ pywin32-Bugs-3304799 ] stdout and stderr fail as service
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2011-05-30 19:52:06
|
Bugs item #3304799, was opened at 2011-05-19 16:20 Message generated for change (Comment added) made by rupole You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3304799&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: win32 Group: None >Status: Pending Resolution: None Priority: 5 Private: No Submitted By: Steve Kelker (skelker) Assigned to: Nobody/Anonymous (nobody) Summary: stdout and stderr fail as service Initial Comment: Overall, you implementation of win32 is excellent. I have one issue to report: There appears to be a bug in either implementation of stderr/stdout for window's services, or there is an error in the way the os handles it, but if you write to stdout or stderr from a windows service using win32 service implementation, the script will throw an exception after a buffer fills up. It looks like the buffer is probably 4k based on some googling I've done and the results of the attached script. The attached script proves this bug exists. It fails on the 228th time that it tries to write an 18 byte string to stdout. If you install the attached script: test_logger.py install Then start the service, it will shut itself down after writing this error to the system event log: Failed on the 227 write to stdout: Traceback (most recent call last): File "D:\SVN\trunk\tool\scripts\python\cashGrainsMQ\test_logger.py", line 41, in appStart print "Writing to stdout" IOError: [Errno 9] Bad file descriptor Thanks for the help. ---------------------------------------------------------------------- >Comment By: Roger Upole (rupole) Date: 2011-05-30 14:52 Message: This is a fairly common issue with services and other apps that don't have a console. There is no real stdout or stderr. Your best bet would be to either assign a file object to sys.stdout and sys.stderr, or use the logging module. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3304799&group_id=78018 |