You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If black is installed under root and run as restricted user following exception is raised:
python3 -m black --diff doc gcovr
Running chmod with sudoTraceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.6/dist-packages/black/__main__.py", line 3, in <module>
patched_main()
File "/usr/local/lib/python3.6/dist-packages/black/__init__.py", line 7002, in patched_main
main()
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 781, in main
with self.make_context(prog_name, args, **extra) as ctx:
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 700, in make_context
self.parse_args(ctx, args)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1048, in parse_args
value, args = param.handle_parse_result(ctx, opts, args)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1630, in handle_parse_result
value = invoke_param_callback(self.callback, ctx, self, value)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 123, in invoke_param_callback
return callback(ctx, param, value)
File "/usr/local/lib/python3.6/dist-packages/black/__init__.py", line 337, in read_pyproject_toml
value = find_pyproject_toml(ctx.params.get("src", ()))
File "/usr/local/lib/python3.6/dist-packages/black/__init__.py", line 315, in find_pyproject_toml
return str(path_user_pyproject_toml) if path_user_pyproject_toml.is_file() else None
File "/usr/lib/python3.6/pathlib.py", line 1362, in is_file
return S_ISREG(self.stat().st_mode)
File "/usr/lib/python3.6/pathlib.py", line 1158, in stat
return self._accessor.stat(self)
File "/usr/lib/python3.6/pathlib.py", line 387, in wrapped
return strfunc(str(pathobj), *args)
PermissionError: [Errno 13] Permission denied: '/root/.config/black'
Describe the bug
If black is installed under root and run as restricted user following exception is raised:
To Reproduce
python3 -m black --diff .
Expected behavior
The code shall formatted the same way as in `20.8b1, see https://github.com/Spacetown/gcovr/runs/2433190163?check_suite_focus=true.
Environment (please complete the following information):
Does this bug also happen on master?
This is the current master.
Additional context
The text was updated successfully, but these errors were encountered: