Commits

Victor Stinner  committed 77a6a24

copy_absolute() keeps the relative path on _Py_wgetcwd() failure

.. instead of raising a fatal error. Even if the current directory was deleted,
use relative paths may still work (eg. run Python with "../python").

  • Participants
  • Parent commits 1c4774b

Comments (0)

Files changed (1)

File Modules/getpath.c

     if (p[0] == SEP)
         wcscpy(path, p);
     else {
-        if (!_Py_wgetcwd(path, MAXPATHLEN))
-            Py_FatalError("unable to get the current directory");
+        if (!_Py_wgetcwd(path, MAXPATHLEN)) {
+            /* unable to get the current directory */
+            wcscpy(path, p);
+            return;
+        }
         if (p[0] == '.' && p[1] == SEP)
             p += 2;
         joinpath(path, p);