Ronald Oussoren added the comment: Isn't this because the first entry of sys.path is '' when python is started without a script? All other paths on sys.path are already absolute paths (tested with a relative path in $PYTHONPATH).
If that's correct, just adding os.getcwd() instead of '' as the first entry of sys.path would fix this issue, and would also make sure that imports of modules next to the script keep working when the script uses os.chdir. The disadvantage is that some users might depend on the current behavior :-( ---------- nosy: +ronaldoussoren _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18416> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com