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 lemburg
Recipients lemburg, python-dev, vinay.sajip
Date 2014-06-11.08:46:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1402476362.0.0.677231224925.issue21709@psf.upfronthosting.co.za>
In-reply-to
Content
Hi Vinaj,

thanks for the patch, but it doesn't really help outside of py2exe. The sys.frozen flag is not an official Python API and it's unlikely to become one, since you can freeze the whole application or just parts of it, which sys.frozen would not be able to address.

Instead, the modules in the stdlib should be aware of the fact that __file__ is not always available and provide fallback solutions.

Could you please use a fix that works for Python tools in general ?

E.g. instead of doing an equal test inf .findCaller() it may be better to use a regular expression or you could patch the __init__ module's co_filename into the module as _srcfile (after it's fully initialized).

Thanks.
History
Date User Action Args
2014-06-11 08:46:02lemburgsetrecipients: + lemburg, vinay.sajip, python-dev
2014-06-11 08:46:02lemburgsetmessageid: <1402476362.0.0.677231224925.issue21709@psf.upfronthosting.co.za>
2014-06-11 08:46:01lemburglinkissue21709 messages
2014-06-11 08:46:01lemburgcreate