pre-commit/pre_commit
francisco souza bb0d9573a9
util: also run chmod on EPERM
Writing a test for this one is tricky, because I was seeing the issue
only when the directory being removed is a docker volume, so instead of
getting EACCES we get EPERM.

This is easy to reproduce though. The existing test fails when the
directory being used for the files is a docker volume:

```
% docker run \
	-v $(mktemp -d):/tmp \
	-v ${PWD}:/src \
	-w /src \
	python:3 \
	bash -c 'pip install -e . && pip install -r requirements-dev.txt && python -m pytest tests/util_test.py'
```
2020-12-05 22:26:38 -05:00
..
commands fix the default value for types_or 2020-11-25 18:21:37 -08:00
languages fix for base executable with non-ascii characters on windows 2020-11-25 12:44:48 -08:00
meta_hooks add types_or 2020-11-02 17:25:10 +00:00
resources update rbenv / ruby-build 2020-09-22 23:03:01 -07:00
__init__.py Initial commit. 2014-03-12 20:25:19 -07:00
__main__.py upgrade hooks, pyupgrade pre-commit 2020-01-12 09:27:04 -08:00
clientlib.py fix the default value for types_or 2020-11-25 18:21:37 -08:00
color.py warn on old list-style configuration 2020-07-25 13:04:54 -07:00
constants.py add support for post-commit 2020-04-27 10:55:22 -07:00
envcontext.py use slightly simpler enum syntax 2020-11-09 12:29:57 -08:00
error_handler.py Distinct error handling exit codes 2020-10-28 11:13:04 -07:00
errors.py check cygwin mismatch earlier 2020-09-20 10:42:11 -07:00
file_lock.py upgrade mypy to get typeshed fixes 2020-07-08 13:55:28 -07:00
git.py don't crash on cygwin mismatch check 2020-11-28 15:20:14 -08:00
hook.py add types_or 2020-11-02 17:25:10 +00:00
logging_handler.py Some manual .format() -> f-strings 2020-01-12 13:39:53 -08:00
main.py check cygwin mismatch earlier 2020-09-20 10:42:11 -07:00
make_archives.py update rbenv / ruby-build 2020-09-22 23:03:01 -07:00
output.py More miscellaneous cleanup 2020-01-13 11:47:34 -08:00
parse_shebang.py Use covdefaults to handle coveragerc 2020-02-29 14:25:19 -08:00
prefix.py Add types to pre-commit 2020-01-12 10:15:01 -08:00
repository.py fix atomic file replace on windows 2020-08-23 10:18:59 -07:00
staged_files_only.py fix hooks firing during staged_files_only 2020-05-02 14:00:21 -07:00
store.py fix atomic file replace on windows 2020-08-23 10:18:59 -07:00
util.py util: also run chmod on EPERM 2020-12-05 22:26:38 -05:00
xargs.py improve xargs when running windows batch files 2020-11-06 13:09:01 -08:00