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 lukasz.langa
Recipients andrei.avk, aroberge, lukasz.langa
Date 2021-07-16.13:54:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1626443669.33.0.530166307988.issue44648@roundup.psfhosted.org>
In-reply-to
Content
Why do you think OSError fits here? Since objects provided on the command line by definition cannot have source code files, the problem isn't that the file is missing or inaccessible. Rather, the value provided to getsource() is wrong. So, in my view, this should rather be ValueError.

Moreover, checking for __main__ is insufficient as there are __main__.py modules after all in many packages.
History
Date User Action Args
2021-07-16 13:54:29lukasz.langasetrecipients: + lukasz.langa, aroberge, andrei.avk
2021-07-16 13:54:29lukasz.langasetmessageid: <1626443669.33.0.530166307988.issue44648@roundup.psfhosted.org>
2021-07-16 13:54:29lukasz.langalinkissue44648 messages
2021-07-16 13:54:29lukasz.langacreate