Lars Gustäbel added the comment:

TarFile.makelink() has a fallback mode in case the platform does not support 
links. Instead of a symlink or a hardlink it extracts the file it points to as 
long as it exists in the current archive.

More precisely, makelink() calls os.symlink() and if one of the exceptions in 
the symlink_exception tuple is raised, it goes into fallback mode. r80944 
introduced a regression because it replaced the WindowsError in 
symlink_exception with an OSError which is much less specific than a 
WindowsError. Since that change, the fallback is used everytime an OSError 
occurs, in Michael's case it is a FileExistsError, because the symlink is 
already there.

The attached patch restores the old behavior. This might not be what you 
wanted, Michael, but at least, tarfile no longer crashes.

----------
Added file: http://bugs.python.org/file42780/windowserror.diff

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

Reply via email to