Issue 26035: traceback.print_tb() takes tb, not traceback as a keyword argument (original) (raw)

Created on 2016-01-07 04:47 by nchammas, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
func_args_name.patch upendra-k14,2016-01-08 09:58
Messages (6)
msg257670 - (view) Author: Nicholas Chammas (nchammas) * Date: 2016-01-07 04:47
Here is traceback.print_tb()'s signature [0]: ``` def print_tb(tb, limit=None, file=None): ``` However, its documentation reads [1]: ``` .. function:: print_tb(traceback, limit=None, file=None) ``` Did the keyword argument change recently, or was this particular doc always wrong? [0] https://github.com/python/cpython/blob/1fe0fd9feb6a4472a9a1b186502eb9c0b2366326/Lib/traceback.py#L43 [1] https://raw.githubusercontent.com/python/cpython/1fe0fd9feb6a4472a9a1b186502eb9c0b2366326/Doc/library/traceback.rst
msg257673 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-01-07 06:13
According to the history, the parameter was always called “tb” in the implementation <https://hg.python.org/cpython/annotate/93df83022be8/Lib/traceback.py#l7>, and the documentation always had it wrong <https://hg.python.org/cpython/annotate/1c29f6bdd898/Doc/lib/libtraceback.tex#l18>. So I would change the documentation to “tb”. It looks like other functions in this module have the wrong parameter names also.
msg257747 - (view) Author: Upendra Kumar (upendra-k14) * Date: 2016-01-08 09:58
I am submitting a patch for this documentation issue. I have changed the function parameters name 'traceback' to 'tb'. Because of this I have also introduced changes in the text of the documentation to maintain coherency. I found some more inconsistent function parameter's name: I have changed them : 'type' to 'etype' in functions print_exception, format_exception_only, format_exception 'list' to 'extracted_list' in function format_list '
msg258362 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-01-16 05:46
New changeset e40f6c3dc114 by Senthil Kumaran in branch '3.5': Issue26035 - Correct the argument names used in the docs of the traceback module. Make it consistent with module args. https://hg.python.org/cpython/rev/e40f6c3dc114 New changeset e96c1491896d by Senthil Kumaran in branch 'default': Merge from 3.5 https://hg.python.org/cpython/rev/e96c1491896d
msg258364 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-01-16 06:13
New changeset daff4ced1b32 by Senthil Kumaran in branch '2.7': Issue26035 - Correct the argument names used in the docs of the traceback module. Make it consistent with module args. https://hg.python.org/cpython/rev/daff4ced1b32
msg258365 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2016-01-16 06:14
Thanks for the patch, Upendra Kumar. It's fixed now. Appreciate your taking care of other args and making the change meaningful.
History
Date User Action Args
2022-04-11 14:58:25 admin set github: 70223
2016-01-16 06:14:51 orsenthil set status: open -> closedtype: behaviorassignee: docs@python -> orsenthilnosy: + orsenthilmessages: + resolution: fixedstage: needs patch -> resolved
2016-01-16 06:13:24 python-dev set messages: +
2016-01-16 05:46:17 python-dev set nosy: + python-devmessages: +
2016-01-08 09:58:06 upendra-k14 set files: + func_args_name.patchnosy: + upendra-k14messages: + keywords: + patch
2016-01-07 08:45:29 berker.peksag set keywords: + easy
2016-01-07 06:13:07 martin.panter set versions: + Python 2.7nosy: + martin.pantermessages: + stage: needs patch
2016-01-07 04:47:35 nchammas create