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 amaury.forgeotdarc
Recipients Sebastian, amaury.forgeotdarc, brett.cannon
Date 2010-05-25.08:04:28
SpamBayes Score 0.026322545
Marked as misclassified No
Message-id <1274774671.77.0.38204397152.issue8787@psf.upfronthosting.co.za>
In-reply-to
Content
Yes, the warnings module tries to display the file name. Inside PyRun_SimpleString(), globals()['__name__'] == '__main__', and the warnings module supposes that argv[1] is the name of the script.

I wonder whether __file__ would be more accurate: it is filled when running a script, but not when running a string. And sys.argv would not be used any more.
History
Date User Action Args
2010-05-25 08:04:32amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, brett.cannon, Sebastian
2010-05-25 08:04:31amaury.forgeotdarcsetmessageid: <1274774671.77.0.38204397152.issue8787@psf.upfronthosting.co.za>
2010-05-25 08:04:30amaury.forgeotdarclinkissue8787 messages
2010-05-25 08:04:29amaury.forgeotdarccreate