Serhiy Storchaka added the comment: The issue is not in os.path, but in __file__ been relative path. If you change current work directory, __file__ is no longer valid path to source file. Things are even worse with zipimport. When you will archive the script in the ZIP file and run this ZIP file, __file__ will not be a path to the source file from the start.
See also issue18416. ---------- nosy: +brett.cannon, eric.snow, ncoghlan _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24670> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com