diff -r 07425df887b5 Modules/posixmodule.c --- a/Modules/posixmodule.c Sun Dec 01 17:27:40 2013 -0800 +++ b/Modules/posixmodule.c Mon Dec 02 12:28:50 2013 +0800 @@ -1280,13 +1280,19 @@ path_error(char *function_name, path_t *path) { #ifdef MS_WINDOWS - if (path->narrow) - return win32_error(function_name, path->narrow); - if (path->wide) - return win32_error_unicode(function_name, path->wide); - return win32_error(function_name, NULL); -#else - return path_posix_error(function_name, path); + if (path) { + if (path->narrow) + return win32_error(function_name, path->narrow); + if (path->wide) + return win32_error_unicode(function_name, path->wide); + } else { + return win32_error(function_name, NULL); + } +#else + if (path) + return path_posix_error(function_name, path); + else + return posix_error(); #endif } @@ -3389,7 +3395,7 @@ Py_END_ALLOW_THREADS if (!result) { - return_value = win32_error_object("link", dst.object); + return_value = path_error("link", NULL); goto exit; } #else @@ -3407,7 +3413,7 @@ Py_END_ALLOW_THREADS if (result) { - return_value = path_error("link", &dst); + return_value = path_error("link", NULL); goto exit; } #endif @@ -4196,7 +4202,7 @@ Py_END_ALLOW_THREADS if (!result) { - return_value = win32_error_object(function_name, dst.object); + return_value = path_error(function_name, NULL); goto exit; } @@ -4211,7 +4217,7 @@ Py_END_ALLOW_THREADS if (result) { - return_value = path_error(function_name, &dst); + return_value = path_error(function_name, NULL); goto exit; } #endif @@ -7433,7 +7439,7 @@ Py_END_ALLOW_THREADS if (!result) { - return_value = win32_error_object("symlink", src.object); + return_value = path_error("symlink", NULL); goto exit; } @@ -7449,7 +7455,7 @@ Py_END_ALLOW_THREADS if (result) { - return_value = path_error("symlink", &dst); + return_value = path_error("symlink", NULL); goto exit; } #endif