id	summary	reporter	owner	description	type	status	priority	component	severity	resolution	keywords	cc
283	PyYaml does not create logging handler classes correctly in Python 2.7	jordi.puigsegur@…	xi	"logging.FileHandler and logging.RotatingFileHandler (haven't tried other handlers) do not get correctly initialized in python 2.7 when loaded using  PyYaml.

This example reproduces the problem:
{{{
import logging
import logging.handlers
import yaml

logger = logging.getLogger() # root logger

# Option 1 - OK
##handler = logging.handlers.RotatingFileHandler(filename = ""test.log"", maxBytes = 262144, backupCount = 3)

# Option 2 - RotatingFileHandler fails when created through yaml
handler = yaml.load(""""""
!!python/object/new:logging.handlers.RotatingFileHandler
    kwds:
        filename: test.log
        maxBytes: 262144
        backupCount: 3
"""""")

# Option 3 - FileHandler also fails when created through yaml
##handler = yaml.load(""""""
##!!python/object/new:logging.FileHandler
##    kwds:
##        filename: test.log
##"""""")

logger.addHandler(handler)

logger.warning(""test handler"")
}}}


The example above works in python 2.6 and 2.5, but fails in python 2.7. In both cases I am using the latest version of PyYaml: 3.10

I've opened a ticket in python (http://bugs.python.org/issue15616) and it seems that Logging changed from old-style classes in 2.6 to new-style classes in 2.7 and that may be the reason."	defect	new	normal	pyyaml	normal		python 2.7 logging handlers	
