Nobody:

Maybe. On Unix, it's possible that the current directory no longer
has a pathname.

Its also possible that you do not have permission to successfully call getcwd. One example of this I have experienced is the OS X sandbox where you can run Python starting in a directory where you have only limited permissions.

getcwd works by calling readdir and lstat and looping up from the current directory to the root to build the whole path so will break without read permissions on directories:
http://www.opensource.apple.com/source/Libc/Libc-763.13/gen/FreeBSD/getcwd.c

   Neil
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to