mirror of
				https://github.com/django/django.git
				synced 2025-10-30 17:16:10 +00:00 
			
		
		
		
	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.
			
			
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user