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 marco.buttu
Recipients docs@python, marco.buttu
Date 2013-11-01.11:54:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1383306863.35.0.879382426433.issue19472@psf.upfronthosting.co.za>
In-reply-to
Content
I was looking at inspect.getsource(). In Python 3.3 and 3.4 either the docstring and the online doc say it raises a OSError, and in fact: 


>>> import inspect
>>> def foo():
...     pass
... 
>>> inspect.getsource(foo)
Traceback (most recent call last):
    ...
OSError: could not get source code


However, getsource() calls getfile(), and this one raises a TypeError:


>>> inspect.getsource(0)
Traceback (most recent call last):
 ...
TypeError: 0 is not a module, class, method, function, traceback, frame, or code object
History
Date User Action Args
2013-11-01 11:54:23marco.buttusetrecipients: + marco.buttu, docs@python
2013-11-01 11:54:23marco.buttusetmessageid: <1383306863.35.0.879382426433.issue19472@psf.upfronthosting.co.za>
2013-11-01 11:54:23marco.buttulinkissue19472 messages
2013-11-01 11:54:23marco.buttucreate