[issue23838] linecache and MemoryError

Serhiy Storchaka report at bugs.python.org
Wed Apr 1 14:02:28 CEST 2015


Serhiy Storchaka added the comment:

getlines() already returns an empty list on OSError. Clearing the cache on MemoryError will help to avoid other MemoryErrors. And after this there is a large chance the repeated reading will be successful. In any case it wouldn't make worse.

If don't change linecache, then we should patch all places where linecache is used: traceback, idlelib, warnings, trace, debugger, etc. I intentionally made the fix at the low level, so it fixes all issues in one place.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23838>
_______________________________________


More information about the Python-bugs-list mailing list