Skip to content
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.exception doesn't accept custom exc_info #67364

Closed
laimis mannequin opened this issue Jan 6, 2015 · 2 comments
Closed

logging.exception doesn't accept custom exc_info #67364

laimis mannequin opened this issue Jan 6, 2015 · 2 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@laimis
Copy link
Mannequin

laimis mannequin commented Jan 6, 2015

BPO 23175
Nosy @vsajip

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:

assignee = None
closed_at = <Date 2015-01-06.11:15:13.529>
created_at = <Date 2015-01-06.00:54:53.551>
labels = ['type-bug', 'library']
title = "logging.exception doesn't accept custom exc_info"
updated_at = <Date 2015-01-06.11:15:13.528>
user = 'https://bugs.python.org/laimis'

bugs.python.org fields:

activity = <Date 2015-01-06.11:15:13.528>
actor = 'vinay.sajip'
assignee = 'none'
closed = True
closed_date = <Date 2015-01-06.11:15:13.529>
closer = 'vinay.sajip'
components = ['Library (Lib)']
creation = <Date 2015-01-06.00:54:53.551>
creator = 'laimis'
dependencies = []
files = []
hgrepos = []
issue_num = 23175
keywords = []
message_count = 2.0
messages = ['233496', '233517']
nosy_count = 2.0
nosy_names = ['vinay.sajip', 'laimis']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue23175'
versions = ['Python 2.7']

@laimis
Copy link
Mannequin Author

laimis mannequin commented Jan 6, 2015

Documentation says, that "The arguments are interpreted as for debug()." But it's not true, because no matter what exc_info is passed to logging.exception(), exc_info is overwritten (kwargs['exc_info'] = 1) and later self.error is called.
This is either documentation issue or behavior issue, because in the current implementation it's not possible to pass custom exc_info (e.g. full traceback) to logging.exception(), although documentation implies it should work the same as for info, warning, error, debug and others.

@laimis laimis mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jan 6, 2015
@vsajip
Copy link
Member

vsajip commented Jan 6, 2015

2.7 documentation has now been updated. The behaviour has already been changed for Python 3.5 to forward any exc_info passed in (see Issue bpo-20537).

@vsajip vsajip closed this as completed Jan 6, 2015
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant