When linecache doesn't find a source file or fails to read it due to OSError, SyntaxError or UnicodeDecodeError, it returns an empty result. In subsequent attempts it would try to find and read the file again.
We should instead cache the negative lookup result and bypass the search in future queries.
The text was updated successfully, but these errors were encountered:
We may need to understand the following decision that cache was removed for this case. @vstinner, Is this different behavior from what @iritkatriel intended?
I have doubts about this issue as well. It came up in #94410 (comment), where it seemed to make sense, but I've seen other issues where we do/don't want various things cached, and I don't know if there's an obviously correct thing to do here.
iritkatriel commentedJun 30, 2022
When linecache doesn't find a source file or fails to read it due to OSError, SyntaxError or UnicodeDecodeError, it returns an empty result. In subsequent attempts it would try to find and read the file again.
We should instead cache the negative lookup result and bypass the search in future queries.
The text was updated successfully, but these errors were encountered: