[pywin32-bugs] [ pywin32-Bugs-2906084 ] Windows service with logging module
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2009-11-30 23:18:25
|
Bugs item #2906084, was opened at 2009-12-01 03:56 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=2906084&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: None Group: None >Status: Closed >Resolution: Invalid Priority: 5 Private: No Submitted By: jpiron (jpiron) Assigned to: Nobody/Anonymous (nobody) Summary: Windows service with logging module Initial Comment: Dears, When I try to use the logging module in a script that is called by a general script intended to create a windows service that runs the script in a separated thread, I get an IOError: Bad file descriptor For exemple, I have a script that polls a value and logs it every second. It runs flawlessly alone and in debug mode in a service. But once it is started normally. the log process is successfull several times (8 for exemple, and always 8) and the next time, the IOError is raised. I ave tried with several handlers: RotatingFileHandler, FileHandler, and even StreamHandler, with different polling times, different numberd of successive writes and some other parameters. ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2009-12-01 10:18 Message: Services do not have valid sys.stdout or sys.stderr objects. As the logging module uses these by default, it fails. There is nothing suitable python can provide instead of those handles, so the solution is to log to a file. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=2906084&group_id=78018 |