summaryrefslogtreecommitdiff
path: root/django/utils/_os.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@oscaro.com>2015-02-22 17:49:29 +0100
committerAymeric Augustin <aymeric.augustin@oscaro.com>2015-02-22 23:09:42 +0100
commitc688460df6239539d2b5a1fc8c51778086fe7c35 (patch)
tree65043997e20f52f194926092aaf0b3dfcf04b290 /django/utils/_os.py
parentb2f331dc68ec3c5a34285f7af9614e4178e9a371 (diff)
Removed rmtree_errorhandler.
The stated reason for its introduction in d18d37ce no longer applies since Django's code repository was switched from Subversion to git. Furthermore it never had any effect because shutil.rmtree ignores its onerror argument when ignore_errors is True. The reason for its use in template management commands is unclear.
Diffstat (limited to 'django/utils/_os.py')
-rw-r--r--django/utils/_os.py27
1 files changed, 0 insertions, 27 deletions
diff --git a/django/utils/_os.py b/django/utils/_os.py
index f5efeab80f..a874214a58 100644
--- a/django/utils/_os.py
+++ b/django/utils/_os.py
@@ -1,7 +1,6 @@
from __future__ import unicode_literals
import os
-import stat
import sys
import tempfile
from os.path import abspath, dirname, isabs, join, normcase, normpath, sep
@@ -10,12 +9,6 @@ from django.core.exceptions import SuspiciousFileOperation
from django.utils import six
from django.utils.encoding import force_text
-try:
- WindowsError = WindowsError
-except NameError:
- class WindowsError(Exception):
- pass
-
if six.PY2:
fs_encoding = sys.getfilesystemencoding() or sys.getdefaultencoding()
@@ -86,26 +79,6 @@ def safe_join(base, *paths):
return final_path
-def rmtree_errorhandler(func, path, exc_info):
- """
- On Windows, some files are read-only (e.g. in in .svn dirs), so when
- rmtree() tries to remove them, an exception is thrown.
- We catch that here, remove the read-only attribute, and hopefully
- continue without problems.
- """
- exctype, value = exc_info[:2]
- # looking for a windows error
- if exctype is not WindowsError or 'Access is denied' not in str(value):
- raise
- # file type should currently be read only
- if ((os.stat(path).st_mode & stat.S_IREAD) != stat.S_IREAD):
- raise
- # convert to read/write
- os.chmod(path, stat.S_IWRITE)
- # use the original function to repeat the operation
- func(path)
-
-
def symlinks_supported():
"""
A function to check if creating symlinks are supported in the