Having a function is definitely cleaner. Creating a HOME environment variable where one does not exist in the calling shell is misleading.
There are 10 modules in the python 2.3 lib directory that contain os.environ['HOME']: lib\ftplib.py lib\mailbox.py lib\mailcap.py lib\netrc.py lib\ntpath.py lib\os2emxpath.py lib\pdb.py lib\posixpath.py lib\rfc822.py lib\user.py It's probably not a huge effort to change these (but that's easy for me to say ...) It would be nice to start of with having a standard way to find out what the home directory is. -- http://mail.python.org/mailman/listinfo/python-list