Message304698
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. |
|
Date |
User |
Action |
Args |
2017-10-21 08:18:44 | ncoghlan | set | recipients:
+ ncoghlan, brett.cannon, vinay.sajip, jaraco, eric.araujo, Arfrever, eric.snow, serhiy.storchaka |
2017-10-21 08:18:44 | ncoghlan | set | messageid: <1508573924.38.0.213398074469.issue16737@psf.upfronthosting.co.za> |
2017-10-21 08:18:44 | ncoghlan | link | issue16737 messages |
2017-10-21 08:18:44 | ncoghlan | create | |
|