Commit 58a9404c by Julien Kauffmann

Fixed incorrect call to logging.debug() that transparently adds a handler to the root logger

Calling `logging.debug()` directly causes a `logging.StreamHandler` to be added to the default root logger `logging.getLogger()`.

This has terrible consequences when one wants to keep control over the handlers of the root logger.

The proposed change fixes that issues while keeping the log output if needed.
parent e82cc735
...@@ -23,6 +23,9 @@ import os.path ...@@ -23,6 +23,9 @@ import os.path
import re import re
import sys import sys
LOGGER = logging.getLogger('rfc6266')
LOGGER.addHandler(logging.NullHandler)
__all__ = ( __all__ = (
'ContentDisposition', 'ContentDisposition',
'parse_headers', 'parse_headers',
...@@ -170,7 +173,7 @@ def parse_headers(content_disposition, location=None, relaxed=False): ...@@ -170,7 +173,7 @@ def parse_headers(content_disposition, location=None, relaxed=False):
"""Build a ContentDisposition from header values. """Build a ContentDisposition from header values.
""" """
logging.debug( LOGGER.debug(
'Content-Disposition %r, Location %r', content_disposition, location) 'Content-Disposition %r, Location %r', content_disposition, location)
if content_disposition is None: if content_disposition is None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment