Skip to content

Commit 485f87d

Browse files
committed
Merge pull request #774 from qwcode/win_fixes
another case for our shutil.rmtree onerror function
2 parents 32ac120 + 0e7c239 commit 485f87d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pip/util.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ def rmtree_errorhandler(func, path, exc_info):
4444
remove them, an exception is thrown. We catch that here, remove the
4545
read-only attribute, and hopefully continue without problems."""
4646
exctype, value = exc_info[:2]
47-
# On Python 2.4, it will be OSError number 13
48-
# On all more recent Pythons, it'll be WindowsError number 5
49-
if not ((exctype is WindowsError and value.args[0] == 5) or
50-
(exctype is OSError and value.args[0] == 13)):
47+
if not ((exctype is WindowsError and value.args[0] == 5) or #others
48+
(exctype is OSError and value.args[0] == 13) or #python2.4
49+
(exctype is PermissionError and value.args[3] == 5) #python3.3
50+
):
5151
raise
5252
# file type should currently be read only
5353
if ((os.stat(path).st_mode & stat.S_IREAD) != stat.S_IREAD):

0 commit comments

Comments
 (0)