views:

40

answers:

2

Guys, I am getting following error while exiting cherrypy server. What is this error about?

2009-11-04 09:32:35,015 WARNING  Error in atexit._run_exitfuncs:
2009-11-04 09:32:35,015 WARNING  

2009-11-04 09:32:35,015 WARNING  Traceback (most recent call last):

2009-11-04 09:32:35,015 WARNING    File "atexit.pyc", line 24, in _run_exitfuncs

2009-11-04 09:32:35,015 WARNING    File "logging\__init__.pyc", line 1486, in shutdown

2009-11-04 09:32:35,015 WARNING    File "logging\__init__.pyc", line 746, in flush

2009-11-04 09:32:35,015 WARNING  IOError: [Errno 9] Bad file descriptor

2009-11-04 09:32:35,015 WARNING  Error in sys.exitfunc:

2009-11-04 09:32:35,015 WARNING  Traceback (most recent call last):

2009-11-04 09:32:35,015 WARNING    File "atexit.pyc", line 24, in _run_exitfuncs

2009-11-04 09:32:35,015 WARNING    File "logging\__init__.pyc", line 1486, in shutdown

2009-11-04 09:32:35,015 WARNING    File "logging\__init__.pyc", line 746, in flush

2009-11-04 09:32:35,015 WARNING  IOError
2009-11-04 09:32:35,015 WARNING  : 
2009-11-04 09:32:35,015 WARNING  [Errno 9] Bad file descriptor
2009-11-04 09:32:35,015 WARNING
A: 

You probably log to console and then close it.

lazy1
A: 

You closed your log file before exiting. The logging shutdown code wants to flush the log file before exiting. What you see here looks like bug #3126 in Python's logging module. It was fixed with:

r64338 | vinay.sajip | 2008-06-17 13:02:14 +0200 (Tue, 17 Jun 2008) | 1 line

Bug #3126: StreamHandler and FileHandler check before calling "flush" and "close " that the stream object has these, using hasattr (thanks to bobf for the patch) .

Which version of Python do you have? Looks like 2.4.6 and 2.5.3 or newer should have the correct code, if this is really the problem.

Andrew Dalke