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 mscuthbert
Recipients BreamoreBoy, Ronny.Pfannschmidt, mscuthbert, r.david.murray
Date 2016-01-31.18:51:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1454266319.39.0.503739011862.issue17446@psf.upfronthosting.co.za>
In-reply-to
Content
this is my first contribution to Python core so I really have no idea how to do this, but I have found a solution (works in Py3.4, 2.7):

in doctest.py after line 1087 ("lineno = getattr(obj, 'co_firstlineno', None)-1")  add these lines:

        if lineno is None and isinstance(obj, property) and \
                obj.fget is not None:
            obj = obj.fget.__code__
            lineno = getattr(obj, 'co_firstlineno', None) 
            # no need for -1 because of decorator. 

I can try to make a patch file for this, but just want to be sure I'm on the right track for contributing first.  I know how to do a Git pull, but not hg/patch.

(p.s., I think the current code "lineno = getattr(obj, 'co_firstlineno', None)-1" has an error; if the getattr does not find 'co_firstlineno', it will return None and then subtract 1 from None which is a TypeError).
History
Date User Action Args
2016-01-31 18:51:59mscuthbertsetrecipients: + mscuthbert, r.david.murray, BreamoreBoy, Ronny.Pfannschmidt
2016-01-31 18:51:59mscuthbertsetmessageid: <1454266319.39.0.503739011862.issue17446@psf.upfronthosting.co.za>
2016-01-31 18:51:59mscuthbertlinkissue17446 messages
2016-01-31 18:51:59mscuthbertcreate