New submission from Hervé Coatanhay: In python 2.7 this code works:
>>> import logging.config >>> import StringIO >>> a="""[loggers] ... keys = root ... [logger_root] ... handlers = "" ... [formatters] ... keys = "" ... [handlers] ... keys = "" ... """ >>> logging.config.fileConfig(StringIO.StringIO(a)) >>> whereas in python 3.3 it raises an exception: >>> import logging.config >>> import io >>> a="""[loggers] ... keys = root ... [logger_root] ... handlers = "" ... [formatters] ... keys = "" ... [handlers] ... keys = "" ... """ >>> logging.config.fileConfig(io.StringIO(a)) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/logging/config.py", line 70, in fileConfig formatters = _create_formatters(cp) File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/logging/config.py", line 114, in _create_formatters class_name = cp[sectname].get("class") File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/configparser.py", line 942, in __getitem__ raise KeyError(key) KeyError: 'formatter_""' >>> ---------- components: Library (Lib) messages: 184435 nosy: Alzakath priority: normal severity: normal status: open title: logging.config.fileConfig error type: behavior versions: Python 3.3 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17453> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com