[issue8720] undo findsource regression/change

2010-05-14 Thread holger krekel
New submission from holger krekel : Somewhere between python 3.0.1 and 3.1.2 the behaviour of inspect.findsource changed: it does not find the source code anymore for a code object whose filename/source is in the linecache.cache because instead of the previous:: file = getsourcefile(object

[issue8720] undo findsource regression/change

2010-05-14 Thread Trundle
Trundle added the comment: This was changed due to issue #4050. -- nosy: +Trundle ___ Python tracker ___ ___ Python-bugs-list mailing

[issue8720] undo findsource regression/change

2010-05-14 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +r.david.murray versions: +Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue8720] undo findsource regression/change

2010-05-14 Thread R. David Murray
R. David Murray added the comment: As I remember it, #4050 was in turn caused by a change elsewhere in the codebase to using linecache where it wasn't used before. Regardless, though, the problem is that findsource doesn't produce an error when called on a binary module. It thinks it found th

[issue8720] undo findsource regression/change

2010-05-15 Thread holger krekel
holger krekel added the comment: Thanks for helping with this! Attached is a patch that adds a keyword "check=True" to getsourcefile so that findsource can defer existence-checking until after cache lookup. Eventually, findsource will still raise an IOError if it can't find the source file

[issue8720] undo findsource regression/change

2010-05-20 Thread R. David Murray
R. David Murray added the comment: Holger, what do you think of this alternate patch that instead makes getsourcefile smarter? It's a simpler patch and doesn't change the API, and your tests (suitably modified) pass. -- stage: -> patch review Added file: http://bugs.python.org/file1

[issue8720] undo findsource regression/change

2010-05-21 Thread holger krekel
holger krekel added the comment: David, your getsourcefile.patch looks fine (and better than mine) to me. -- ___ Python tracker ___ __

[issue8720] undo findsource regression/change

2010-05-21 Thread holger krekel
holger krekel added the comment: Well, maybe we could introduce a "linecache.setlines" function to give the linecache module control over its internal caching and data handling. What do you think? -- ___ Python tracker

[issue8720] undo findsource regression/change

2010-06-16 Thread holger krekel
holger krekel added the comment: Seems the inspect.getsourcefile regression now is in the RC1 of Python2.7 as well. I suggest to apply the "getsourcefile.patch" patch which was attached from David. I tested it and it works fine for Python2.7 and Python3.1. -- status: open -> pending

[issue8720] undo findsource regression/change

2010-06-16 Thread R. David Murray
R. David Murray added the comment: I've applied the patch to trunk in r82039, to py3k in r82041, and 3.1 in r82042. Holger, I'm not really familiar with the linecache module and its uses, so I'm not sure what your proposal is aimed at. Perhaps you could flesh out your proposal in a new ticke