Executing the attached "inspect_failure.py" under python2.6 or python3.1 results in an assertion error: Python fails to obtain the source code of a function that is defined at the end of a module whose last line does not contain a line ending character. After brief analysis i think there are two approaches to fixing it: normalizing newlines in inspect.findsource (see attached inspect.patch file against r312) or performing normalization in linecache.updatecache which does it already for source code obtained from PEP302 loaders. Or any other ideas?
Great. Also to be backported to 2.x? holger On Fri, May 21, 2010 at 11:32 PM, Benjamin Peterson <report@bugs.python.org> wrote: > > Benjamin Peterson <benjamin@python.org> added the comment: > > Fixed in r81432 by making linecache smarter. > > ---------- > nosy: +benjamin.peterson > resolution: -> fixed > status: open -> closed > > _______________________________________ > Python tracker <report@bugs.python.org> > <http://bugs.python.org/issue8782> > _______________________________________ >