diff -r d2c464d2ee82 Lib/site.py --- a/Lib/site.py Sat Jul 03 15:57:30 2010 +0200 +++ b/Lib/site.py Thu Jul 29 16:57:50 2010 -0400 @@ -102,7 +102,10 @@ # Filter out duplicate paths (on case-insensitive file systems also # if they only differ in case); turn relative paths into absolute # paths. - dir, dircase = makepath(dir) + try: + dir, dircase = makepath(dir) + except os.error: + continue if not dircase in known_paths: L.append(dir) known_paths.add(dircase) diff -r d2c464d2ee82 Lib/sysconfig.py --- a/Lib/sysconfig.py Sat Jul 03 15:57:30 2010 +0200 +++ b/Lib/sysconfig.py Thu Jul 29 16:57:50 2010 -0400 @@ -434,8 +434,12 @@ # from a different directory. if _PYTHON_BUILD and os.name == "posix": base = _PROJECT_BASE + try: + cwd = os.getcwd() + except os.error: + cwd = None if (not os.path.isabs(_CONFIG_VARS['srcdir']) and - base != os.getcwd()): + base != cwd): # srcdir is relative and we are not in the same directory # as the executable. Assume executable is in the build # directory and make srcdir absolute.