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: bdb calls linecache.checkcache, resulting in source being different from code
Type: Stage: patch review
Components: Library (Lib) Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: blueyed
Priority: normal Keywords: patch

Created on 2020-03-15 09:27 by blueyed, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 19013 open blueyed, 2020-03-15 09:28
Messages (1)
msg364224 - (view) Author: daniel hahler (blueyed) * Date: 2020-03-15 09:27
`Bdb.reset` calls `linecache.checkcache`, which will clear the cache for any updated source files.

This however might result in displayed source code being different from the actual code, in case you are editing the file being currently debugged.

I think it is better to keep the initially cached version (which might still get invalidated/checked via inspect itself), but that is another issue.

The code is very old already, merged in b6775db241:

  commit b6775db241
  Author: Guido van Rossum <guido@python.org>
  Date:   Mon Aug 1 11:34:53 1994 +0000

      Merge alpha100 branch back to main trunk

I will try a PR that removes it to see if it causes any test failures.

Code ref: https://github.com/python/cpython/blob/598d29c51c7b5a77f71eed0f615eb0b3865a4085/Lib/bdb.py#L56-L57
History
Date User Action Args
2022-04-11 14:59:28adminsetgithub: 84148
2020-03-15 09:28:41blueyedsetkeywords: + patch
stage: patch review
pull_requests: + pull_request18360
2020-03-15 09:27:24blueyedcreate