end-of-file-fixer hook does not handle permission errors well
See original GitHub issueI saw this traceback from during execution of pre-commit today:
Traceback (most recent call last):
File "/home/someuser/.cache/pre-commit/repolz82qqa4/py_env-python3/bin/end-of-file-fixer", line 11, in <module>
sys.exit(end_of_file_fixer())
File "/home/someuser/.cache/pre-commit/repolz82qqa4/py_env-python3/lib/python3.5/site-packages/pre_commit_hooks/end_of_file_fixer.py", line 58, in end_of_file_fixer
with open(filename, 'rb+') as file_obj:
PermissionError: [Errno 13] Permission denied: 'some_django_project/migrations/0023_auto_20181120_1541.py'
That file was created from inside a container… Would be nice to not have the backtrace, just an error.
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Container permission denied: How to diagnose this error
Learn what is causing a container permissions error and how to work around the issue without resorting to the --privileged flag.
Read more >post receive hook is showing an error of permission
1 Answer 1 ... Check path-to-beta-dir permissions and ownership.Try changing them.Give to your user as owner or give permissions with chmod for ...
Read more >Getting error trying to start a process via app - UiPath Forum
I am getting the following error when trying to start the process from an app ... webhook with message: You are not authorized!...
Read more >How to fix Error You do not have permission to access…
Every file and directory in the Linux system is owned by a specific user and group and has permissions that allow performing particular...
Read more >File access permissions? - Code Composer Studio forum
I can work around this error by exiting CCS and restarting the program as an ... I believe CCS does not handle user...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You’re free to disagree 😃 – and in most cases I agree with you that a tool should produce error messages instead of stracktraces but in this case and in this particular class of tools and exceptions I don’t:
MemoryError
and any other flavor of “impending doom”)IOError [Errno 13] Permission denied
and no other information…except Exception as e: print(e)
sucks! It’s much more likely to cause confusion (or hide bugs!) than be productive.--debug
option, plus the tests to ensure it would work would dwarf the contents of the actual tool!Well, if you consider showing backtraces cool and I don’t we have hit the bottom here. Let’s close this as wont-fix then?