[issue5013] Problems with delay parm of logging.handlers.RotatingFileHandler

2009-01-20 Thread Fons Dijkstra

New submission from Fons Dijkstra :

When you set the delay parameter of the 
logging.handlers.RotatingFileHandler.__init__() function to True, two 
things go wrong:

1) A previously set formatter is reset (to None) upon lazy creating the 
StreamHandler. That means in practice that you always will have the 
default formatter which just formats the message.

2) Upon a roll-over, the delay parm does not seem to be used anymore as, 
even if there are no records to log, the new current logfile is always 
created.

--
components: Library (Lib)
messages: 80258
nosy: pycurry
severity: normal
status: open
title: Problems with delay parm of logging.handlers.RotatingFileHandler
type: behavior
versions: Python 2.6

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



[issue5088] optparse: inconsistent default value for append actions

2009-01-28 Thread Fons Dijkstra

New submission from Fons Dijkstra :

Although it is possible to specify a default value for an append action,  
either directly or through the set_default() function, it is not handled 
correctly when this default is overruled by the user. Take for example 
the following code:

  import optparse
  parser = optparse.OptionParser()
  parser.add_option("-o", "--option", action = "append")
  parser.set_defaults(option = ["a"])
  options, args = parser.parse_args()
  print options

When this is called without arguments the following is printed:
  {'option': ['a']} # as expected

But when it is called with for example with -ob the following is 
printed:
  {'option': ['a', 'b']} # expected {'option': ['b']}

So the default option is also appended, even if the option is explicitly 
defined by the user.

--
components: Library (Lib)
messages: 80704
nosy: pycurry
severity: normal
status: open
title: optparse: inconsistent default value for append actions
type: behavior
versions: Python 2.6

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