[New-bugs-announce] [issue39967] bdb calls linecache.checkcache, resulting in source being different from code

daniel hahler report at bugs.python.org
Sun Mar 15 05:27:24 EDT 2020


New submission from daniel hahler <python-bugs at thequod.de>:

`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 at 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

----------
components: Library (Lib)
messages: 364224
nosy: blueyed
priority: normal
severity: normal
status: open
title: bdb calls linecache.checkcache, resulting in source being different from code
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39967>
_______________________________________


More information about the New-bugs-announce mailing list