New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
logging KeyError: '<key>' #1417
Comments
Thanks for submitting this, do you think you'd be able to submit a patch to fix the issue? |
I traceback this bug today, and find it a little tricky.
The possible solution might be:
which do you prefer? Or is there other solution? |
I'm wondering if this is actually a bug or if we should recommend users not use the |
No, you understand what I means exactly. I'm not a native english speaker, forgive me, if there is any odd expression. Infact, if you don't use the code is as follow
|
So I don't think this is a urllib3 issue because I can reproduce it without urllib3: import logging
root_logger = logging.getLogger()
sub_logger = logging.getLogger('test')
handler = logging.StreamHandler()
handler.addFormatter(logging.Formatter('%(aVar)'))
root_logger.addHandler(handler)
root_logger.setLevel(logging.NOTSET)
sub_logger.info('testme', extra={})
"""
Traceback (most recent call last):
File "/usr/lib/python3.6/logging/__init__.py", line 987, in emit
msg = self.format(record)
File "/usr/lib/python3.6/logging/__init__.py", line 833, in format
return fmt.format(record)
File "/usr/lib/python3.6/logging/__init__.py", line 573, in format
s = self.formatMessage(record)
File "/usr/lib/python3.6/logging/__init__.py", line 542, in formatMessage
return self._style.format(record)
File "/usr/lib/python3.6/logging/__init__.py", line 386, in format
return self._fmt % record.__dict__
KeyError: 'aVar'
Call stack:
File "<stdin>", line 1, in <module>
Message: 'testme'
Arguments: ()
""" |
OK. Then I'll close the issue. |
Actually, I reproduce an error in the same with this one, which I think maybe a bug of urllib3.
The text was updated successfully, but these errors were encountered: