-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
SyslogHandler's record formatting during emit(..) not covered by try-except block #66965
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
Comments
Not all exceptions occurring during SyslogHandler's emit(..) method are caught and handled since the try-except block only covers the latter part of the method. Execution example: In [1]: import sys In [2]: sys.version In [3]: import logging.handlers In [4]: logging.raiseExceptions = 0 In [5]: syslogHandler = logging.handlers.SysLogHandler() In [6]: logger = logging.getLogger() In [7]: logger.addHandler(syslogHandler) In [8]: logger.critical('1', '1') TypeError Traceback (most recent call last)
<ipython-input-8-3d1c89a066c4> in <module>()
----> 1 logger.critical('1', '1') /usr/lib/python2.7/logging/init.pyc in critical(self, msg, *args, **kwargs) /usr/lib/python2.7/logging/init.pyc in _log(self, level, msg, args, exc_info, extra) /usr/lib/python2.7/logging/init.pyc in handle(self, record) /usr/lib/python2.7/logging/init.pyc in callHandlers(self, record) /usr/lib/python2.7/logging/init.pyc in handle(self, record) /usr/lib/python2.7/logging/handlers.pyc in emit(self, record) /usr/lib/python2.7/logging/init.pyc in format(self, record) /usr/lib/python2.7/logging/init.pyc in format(self, record) /usr/lib/python2.7/logging/init.pyc in getMessage(self) TypeError: not all arguments converted during string formatting In [9]: Executing similar code via StreamHandler for example, doesn't raise the TypeError exception. |
New changeset 54549f9b2ecc by Vinay Sajip in branch 'default': |
N.B. 2.7 and 3.4 also updated, but I accidentally left the issue no. out of the commit message. Relevant changesets are ea7b64406396 and f6a906541476. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: