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 Arfrever, brett.cannon, eric.araujo, eric.snow, jaraco, ncoghlan, serhiy.storchaka, vinay.sajip
Date 2017-10-21.08:18:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1508573924.38.0.213398074469.issue16737@psf.upfronthosting.co.za>
In-reply-to
Content
Is there a relevant discrepancy other than __file__ sometimes being absolute?

If code wants to be certain that __file__ is relative to the current directory, they need to run it through os.relpath() - there's no requirement for implementations one way or the other as to whether __file__ is absolute or relative

If we changed anything in CPython, it would be to make __main__.__file__ always absolute, even for scripts - we already changed plain imports to work that way.
History
Date User Action Args
2017-10-21 08:18:44ncoghlansetrecipients: + ncoghlan, brett.cannon, vinay.sajip, jaraco, eric.araujo, Arfrever, eric.snow, serhiy.storchaka
2017-10-21 08:18:44ncoghlansetmessageid: <1508573924.38.0.213398074469.issue16737@psf.upfronthosting.co.za>
2017-10-21 08:18:44ncoghlanlinkissue16737 messages
2017-10-21 08:18:44ncoghlancreate