Eryk Sun added the comment:

os.symlink needs the target_is_directory argument on Windows. Maybe extract() 
can search for the link target in namelist() to determine if it's a directory 
(i.e. ends in "/"). Note that the flag gets set automatically if the target 
exists, so this is only a problem when a link is extracted before the target.

Also, I think it should fall back on creating a regular file if os.symlink 
raises OSError. On Windows this occurs if the user doesn't have 
SeCreateSymbolicLinkPrivilege. os.symlink raises a plain OSError in this case; 
no errno/winerror is set. (I don't know why it doesn't simply call 
CreateSymbolicLink and raise an exception for the last error, which would be 
ERROR_PRIVILEGE_NOT_HELD.)

----------
nosy: +eryksun

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27318>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to