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 eric.araujo
Recipients Claudiu.Popa, Naddiseo, docs@python, eric.araujo
Date 2013-03-25.02:54:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> It seems to work perfectly on command line though.

If the code is saved in a file, yes, but not in an interactive interpreter.  This is not actually related to IDLE, but to the fact that inspect.getsource merely finds the __file__ attribute of the module object for its argument.  If a module object has no file, the error message indicates that it’s a built-in module (like sys), but this fails to take into account the special __main__ module in an interactive interpreter.

It might be worth it to improve the error message, and in any case the documentation can be improved.
Date User Action Args
2013-03-25 02:54:47eric.araujosetrecipients: + eric.araujo, docs@python, Claudiu.Popa, Naddiseo
2013-03-25 02:54:47eric.araujosetmessageid: <>
2013-03-25 02:54:47eric.araujolinkissue12920 messages
2013-03-25 02:54:47eric.araujocreate