diff -r 7d96679c5d46 Lib/test/test_os.py --- a/Lib/test/test_os.py Sun Jan 22 11:24:29 2012 -0500 +++ b/Lib/test/test_os.py Sun Jan 22 19:10:15 2012 +0100 @@ -500,7 +500,12 @@ f.write("I'm " + path + " and proud of it. Blame test_os.\n") f.close() if support.can_symlink(): - os.symlink(os.path.abspath(t2_path), link_path) + if os.name == 'nt': + def symlink_to_dir(src, dest): + os.symlink(src, dest, True) + else: + symlink_to_dir = os.symlink + symlink_to_dir(os.path.abspath(t2_path), link_path) sub2_tree = (sub2_path, ["link"], ["tmp3"]) else: sub2_tree = (sub2_path, [], ["tmp3"]) @@ -1131,7 +1136,7 @@ os.remove(self.missing_link) def test_directory_link(self): - os.symlink(self.dirlink_target, self.dirlink) + os.symlink(self.dirlink_target, self.dirlink, True) self.assertTrue(os.path.exists(self.dirlink)) self.assertTrue(os.path.isdir(self.dirlink)) self.assertTrue(os.path.islink(self.dirlink)) diff -r 7d96679c5d46 Modules/posixmodule.c --- a/Modules/posixmodule.c Sun Jan 22 11:24:29 2012 -0500 +++ b/Modules/posixmodule.c Sun Jan 22 19:10:15 2012 +0100 @@ -6551,7 +6551,6 @@ wchar_t *wsrc, *wdest; int target_is_directory = 0; DWORD res; - WIN32_FILE_ATTRIBUTE_DATA src_info; if (!check_CreateSymbolicLinkW()) { @@ -6581,16 +6580,6 @@ if (wsrc == NULL) goto error; - /* if src is a directory, ensure target_is_directory==1 */ - if( - GetFileAttributesExW( - wsrc, GetFileExInfoStandard, &src_info - )) - { - target_is_directory = target_is_directory || - (src_info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); - } - Py_BEGIN_ALLOW_THREADS res = Py_CreateSymbolicLinkW(wdest, wsrc, target_is_directory); Py_END_ALLOW_THREADS