[issue8581] Logging handlers do not handle double-closing very well

2010-05-03 Thread Vinay Sajip

Vinay Sajip  added the comment:

Fix checked into release26-maint (r80713).

--
resolution: out of date -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8581] Logging handlers do not handle double-closing very well

2010-05-01 Thread Jason Baker

Jason Baker  added the comment:

Vinay, I don't necessarily disagree with you.  However, this appears to be  a 
pretty trivial change.  If there is a 2.6.6, I think this should go in it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8581] Logging handlers do not handle double-closing very well

2010-05-01 Thread Vinay Sajip

Vinay Sajip  added the comment:

- Original Message 

> From: Santoso Wijaya 
> File-like objects handle multiple close() gracefully, silently 
> making the second and subsequent close() calls to an already closed I/O 
> object 
> do nothing. Why can't the same expectation be applied to logging 
> handlers?

I'm not objecting to the change on philosophical grounds, merely commenting 
that it doesn't happen in 2.7/3.2 and suggesting it's not worth fixing in 
2.6/3.1.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8581] Logging handlers do not handle double-closing very well

2010-05-01 Thread Santoso Wijaya

Santoso Wijaya  added the comment:

File-like objects handle multiple close() gracefully, silently making the 
second and subsequent close() calls to an already closed I/O object do nothing. 
Why can't the same expectation be applied to logging handlers?

--
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8581] Logging handlers do not handle double-closing very well

2010-05-01 Thread Vinay Sajip

Vinay Sajip  added the comment:

This part of the code has been changed in trunk (to use weak references), and 
the error does not occur in Python 2.7/3.2.

I'm not sure I fully agree with your assertion that it's not a programmer error 
to close a handler twice - this could certainly happen as a result of a bug in 
the application.

So, I'm not sure (now that we're in Python 2.7 beta) that it's worth 
backporting this to 2.6.6.

Thoughts?

--
resolution:  -> out of date
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8581] Logging handlers do not handle double-closing very well

2010-04-30 Thread Santoso Wijaya

Changes by Santoso Wijaya :


--
nosy: +santa4nt

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8581] Logging handlers do not handle double-closing very well

2010-04-30 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
assignee:  -> vinay.sajip
nosy: +vinay.sajip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8581] Logging handlers do not handle double-closing very well

2010-04-30 Thread Jason Baker

Jason Baker  added the comment:

Adding patch

--
keywords: +patch
Added file: http://bugs.python.org/file17151/logging.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8581] Logging handlers do not handle double-closing very well

2010-04-30 Thread Jason Baker

New submission from Jason Baker :

The logging handler does not handle double-closing very well:

>>> from logging import StreamHandler
>>> h = StreamHandler()
>>> h.close()
>>> h.close()
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.6/logging/__init__.py", line 705, in close
del _handlers[self]
KeyError: 

There are two possible approaches to this:

 1. Raise a better error.
 2. Ignore the duplicate close.

This patch takes option 2 as this is likely not indicative of any kind of 
programmer error, but it shouldn't be too difficult to take option 1 instead.

--
components: Library (Lib)
messages: 104662
nosy: Jason.Baker
priority: normal
severity: normal
status: open
title: Logging handlers do not handle double-closing very well
type: behavior
versions: Python 2.6, Python 3.1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com