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 ncoghlan
Recipients brett.cannon, eric.araujo, ncoghlan, serhiy.storchaka, vinay.sajip
Date 2012-12-22.10:16:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1356171375.49.0.0126866834296.issue16737@psf.upfronthosting.co.za>
In-reply-to
Content
So yes, any code that assumes __main__.__file__ is a relative path is just plain wrong, as Python provides no such guarantee. It may currently be either relative or absolute at the implementation's discretion.

If the status quo ever changes, it would be to switch to requiring that all module __file__ attributes be absolute paths (including in __main__).
History
Date User Action Args
2012-12-22 10:16:15ncoghlansetrecipients: + ncoghlan, brett.cannon, vinay.sajip, eric.araujo, serhiy.storchaka
2012-12-22 10:16:15ncoghlansetmessageid: <1356171375.49.0.0126866834296.issue16737@psf.upfronthosting.co.za>
2012-12-22 10:16:15ncoghlanlinkissue16737 messages
2012-12-22 10:16:14ncoghlancreate