This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Tracemalloc's format() doc contradictory
Type: Stage: resolved
Components: Documentation Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: andrei.avk, docs@python, lisroach, lukasz.langa, miss-islington, pablogsal
Priority: low Keywords: easy, newcomer friendly, patch

Created on 2020-10-14 17:09 by lisroach, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 27529 merged andrei.avk, 2021-08-01 17:05
PR 28428 merged miss-islington, 2021-09-17 22:25
PR 28429 merged miss-islington, 2021-09-17 22:25
Messages (7)
msg378636 - (view) Author: Lisa Roach (lisroach) * (Python committer) Date: 2020-10-14 17:09
Tracemalloc's format documentation (https://docs.python.org/3/library/tracemalloc.html#tracemalloc.Traceback.format) says first:

"Format the traceback as a list of lines with newlines."

then:

"Similar to the traceback.format_tb() function, except that format() does not include newlines."

The first statement is incorrect, tracemalloc does NOT add newlines to the list. I recommend just removing the "with newlines" in the first statement.
msg398715 - (view) Author: Andrei Kulakov (andrei.avk) * (Python triager) Date: 2021-08-01 17:07
I agree that the doc is wrong; I've put up the tiny PR here:
https://github.com/python/cpython/pull/27529/files

Note that linecache.getline() returns line with \n but is then .strip()'ed.
msg402102 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-09-17 22:25
New changeset aca0e08c5dcc11a8011697331931cde0b21270f2 by andrei kulakov in branch 'main':
bpo-42038: fix description of returned list of lines (GH-27529)
https://github.com/python/cpython/commit/aca0e08c5dcc11a8011697331931cde0b21270f2
msg402106 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-09-17 22:56
New changeset bba2332303c60d7326f08aa639ff03a6b5d44d04 by Miss Islington (bot) in branch '3.10':
bpo-42038: fix description of returned list of lines (GH-27529) (GH-28428)
https://github.com/python/cpython/commit/bba2332303c60d7326f08aa639ff03a6b5d44d04
msg402107 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-09-17 22:56
New changeset 6302701179c458da637d669d7e88734fabb79cf6 by Miss Islington (bot) in branch '3.9':
bpo-42038: fix description of returned list of lines (GH-27529) (GH-28429)
https://github.com/python/cpython/commit/6302701179c458da637d669d7e88734fabb79cf6
msg402108 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-09-17 22:56
Thanks! ✨ 🍰 ✨
msg403158 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-10-04 19:18
New changeset 84d56ec4bc0cb44629ba898a30eece48546828d2 by Pablo Galindo (Miss Islington (bot)) in branch '3.10':
bpo-42038: fix description of returned list of lines (GH-27529) (GH-28428)
https://github.com/python/cpython/commit/84d56ec4bc0cb44629ba898a30eece48546828d2
History
Date User Action Args
2022-04-11 14:59:36adminsetgithub: 86204
2021-10-04 19:18:42pablogsalsetnosy: + pablogsal
messages: + msg403158
2021-09-19 23:53:35terry.reedysetversions: + Python 3.11, - Python 3.6, Python 3.7, Python 3.8
2021-09-17 22:56:58lukasz.langasetstatus: open -> closed
resolution: fixed
messages: + msg402108

stage: patch review -> resolved
2021-09-17 22:56:30lukasz.langasetmessages: + msg402107
2021-09-17 22:56:00lukasz.langasetmessages: + msg402106
2021-09-17 22:25:09miss-islingtonsetpull_requests: + pull_request26839
2021-09-17 22:25:04miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request26838
2021-09-17 22:25:02lukasz.langasetnosy: + lukasz.langa
messages: + msg402102
2021-08-01 17:07:07andrei.avksetnosy: docs@python, lisroach, andrei.avk
messages: + msg398715
2021-08-01 17:05:05andrei.avksetkeywords: + patch
nosy: + andrei.avk

pull_requests: + pull_request26044
stage: patch review
2020-10-14 17:10:13lisroachsetkeywords: + easy, newcomer friendly
2020-10-14 17:09:06lisroachcreate