[ python-Bugs-1566280 ] Logging problem on Windows XP

SourceForge.net noreply at sourceforge.net
Wed Dec 6 08:29:23 CET 2006


Bugs item #1566280, was opened at 2006-09-27 13:49
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1566280&group_id=5470

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: Open
Resolution: None
Priority: 7
Private: No
Submitted By: Pavel Krupets (pavel_krupets)
Assigned to: Martin v. Löwis (loewis)
Summary: Logging problem on Windows XP

Initial Comment:
Traceback (most recent call last):
  File "C:\Python\Lib\logging\handlers.py", line 73, in
emit
    if self.shouldRollover(record):
  File "C:\Python\Lib\logging\handlers.py", line 147,
in shouldRollover
    self.stream.seek(0, 2)  #due to non-posix-compliant
Windows feature
ValueError: I/O operation on closed file

not sure why this file is closed.

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2006-12-06 08:29

Message:
Logged In: YES 
user_id=21627
Originator: NO

Ok, so tsample.zip is a test case for the original problem, right? 
I can reproduce the problem on Linux also.

I can't make it crash (on Linux); what do have to do to make it crash?
If I access localhost:8080, I get log messages saying
2006-12-06 07:21:06,999 INFO servlet::__init__:1091 code 404, message File
not found

eloff: this report actually reports two problems (the I/O error, and the
crash).
Which of these are you having and have found lots of people having?

As for the traceback problem: this is due to the main thread terminating,
and
therefore the logging atexit handler getting invoked, which closes the
file.
Only then is the threading atexit handler invoked, which waits until all
non-daemon threads terminate.

As a work-around, add httpServer.join() at the end of your script.

I'll attach a patch that fixes this problem in the Python library.
File Added: threading.diff

----------------------------------------------------------------------

Comment By: Daniel Eloff (eloff)
Date: 2006-12-06 04:05

Message:
Logged In: YES 
user_id=730918
Originator: NO

I have this problem, I'm googling this and finding lots of people having
the same problem. I'm running python 2.5 on windows XP and using the
rotating file handler. I've disabled the logger in my application so I can
continue development.

----------------------------------------------------------------------

Comment By: Pavel Krupets (pavel_krupets)
Date: 2006-09-29 15:52

Message:
Logged In: YES 
user_id=1007725

to start application please use: src/py/run.bat
to get closed handler error (if you manage to start it)
please open your web browser and try to visit:
http://localhost:8080

You can change http settings in src/conf/development/robot.conf

sorry code is quite raw just started. :)

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2006-09-28 05:29

Message:
Logged In: YES 
user_id=21627

Can you provide a test case for either problem?

----------------------------------------------------------------------

Comment By: Pavel Krupets (pavel_krupets)
Date: 2006-09-27 14:01

Message:
Logged In: YES 
user_id=1007725

And I think python crashes on Windows if I try to use logger
from several threads.

Unhandled exception at 0x7c901010 in python.exe: 0xC0000005:
Access violation reading location 0x00000034.

>	ntdll.dll!7c901010() 	
 	[Frames below may be incorrect and/or missing, no symbols
loaded for ntdll.dll]	
 	msvcr71.dll!7c34f639() 	
 	msvcr71.dll!7c36b3b1() 	
 	python25.dll!1e06c6c0() 	
 	python25.dll!1e08dc97() 	
 	python25.dll!1e03ac12() 	
 	python25.dll!1e03c735() 	
 	python25.dll!1e03cc5f() 	
 	python25.dll!1e04026b() 	
 	python25.dll!1e039a2e() 	
 	python25.dll!1e03ac82() 	
 	python25.dll!1e03cc5f() 	
 	python25.dll!1e04026b() 	
 	python25.dll!1e039a2e() 	
 	python25.dll!1e03ac82() 	
 	python25.dll!1e03cc5f() 	
 	python25.dll!1e04026b() 	
 	python25.dll!1e039a2e() 	
 	python25.dll!1e03ac82() 	
 	python25.dll!1e03cc5f() 	
 	python25.dll!1e04026b() 	
 	python25.dll!1e039a2e() 	
 	python25.dll!1e03ac82() 	
 	python25.dll!1e03cc5f() 	
 	python25.dll!1e04026b() 	
 	python25.dll!1e039a2e() 	
 	python25.dll!1e03ac82() 	
 	python25.dll!1e03cc5f() 	
 	python25.dll!1e03db7d() 	
 	python25.dll!1e0715df() 	
 	python25.dll!1e0268ec() 	
 	python25.dll!1e040a04() 	
 	python25.dll!1e039a8c() 	
 	python25.dll!1e03ac82() 	
 	python25.dll!1e03cc5f() 	
 	python25.dll!1e0622d3() 	
 	python25.dll!1e062660() 	
 	python25.dll!1e061028() 	
 	python25.dll!1e0db1bd() 	
 	python25.dll!1e062676() 	
 	python25.dll!1e03e8c1() 	
 	python25.dll!1e041475() 	
 	python25.dll!1e0414c3() 	
 	python25.dll!1e094093() 	
 	python25.dll!1e062676() 	
 	python25.dll!1e0268ec() 	
 	python25.dll!1e03987a() 	
 	python25.dll!1e033edc() 	
 	python25.dll!1e08dc97() 	
 	python25.dll!1e03ac12() 	
 	python25.dll!1e03cc5f() 	
 	python25.dll!1e07041e() 	
 	python25.dll!1e070385() 	
 	python25.dll!1e03db7d() 	
 	python25.dll!1e039a8c() 	
 	python25.dll!1e03ac82() 	
 	python25.dll!1e03cc5f() 	
 	python25.dll!1e07041e() 	
 	python25.dll!1e039a2e() 	
 	python25.dll!1e03ac82() 	
 	python25.dll!1e03cc5f() 	
 	python25.dll!1e07041e() 	
 	python25.dll!1e03db7d() 	
 	python25.dll!1e0715df() 	
 	python25.dll!1e0268ec() 	
 	python25.dll!1e040a04() 	
 	ntdll.dll!7c90d625() 	
 	ntdll.dll!7c90eacf() 	
 	python25.dll!1e0258d2() 	
 	ntdll.dll!7c9105c8() 	
 	ntdll.dll!7c910551() 	
 	ntdll.dll!7c91056d() 	
 	kernel32.dll!7c80261a() 	
 	kernel32.dll!7c8025f0() 	
 	kernel32.dll!7c8025f0() 	
 	kernel32.dll!7c802532() 	
 	python25.dll!1e0268ec() 	
 	python25.dll!1e03987a() 	
 	python25.dll!1e0cdf07() 	
 	python25.dll!1e0cd899() 	
 	msvcr71.dll!7c34940f() 	
 	kernel32.dll!7c80b683() 	


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1566280&group_id=5470


More information about the Python-bugs-list mailing list