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 <>
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 modules after all in many packages.
Date User Action Args
2021-07-16 13:54:29lukasz.langasetrecipients: + lukasz.langa, aroberge, andrei.avk
2021-07-16 13:54:29lukasz.langasetmessageid: <>
2021-07-16 13:54:29lukasz.langalinkissue44648 messages
2021-07-16 13:54:29lukasz.langacreate