This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author djc
Recipients ajaksu2, brodie, djc, pitrou, r.david.murray
Date 2010-07-17.13:16:54
SpamBayes Score 2.1546193e-06
Marked as misclassified No
Message-id <1279372617.05.0.528440876901.issue9284@psf.upfronthosting.co.za>
In-reply-to
Content
The fix for issue4050 broke some of my doctests. Minimal test:

import doctest, inspect
def test():
    '''
    >>> def x(): pass
    >>> inspect.getsource(x)
    'def x(): pass\\n'
    '''
doctest.run_docstring_examples(test, globals())

This works in 2.6, but not in 2.7. Reason is that inspect.getsourcefile() finds the fake filename '<docTest NoName[0]>', which it doesn't understand. In 2.6, inspect.getmodule() is also tried, which first looks at obj.__module__, and the filename can be derived from that. I suggest that inspect.getsourcefile() grows some code to use this trick if the filename seems fake (f[0] + f[-1] == '<>').
History
Date User Action Args
2010-07-17 13:16:57djcsetrecipients: + djc, pitrou, ajaksu2, brodie, r.david.murray
2010-07-17 13:16:57djcsetmessageid: <1279372617.05.0.528440876901.issue9284@psf.upfronthosting.co.za>
2010-07-17 13:16:55djclinkissue9284 messages
2010-07-17 13:16:54djccreate