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
docker_cmd in languages/docker.py uses os.getuid() and os.getgid() that don't exist in Python on Windows.
A hook that uses Docker on Windows fails to execute with
An unexpected error has occurred: AttributeError: module 'os' has no attribute 'getuid'
Traceback (most recent call last):
File "C:\Python36\lib\site-packages\pre_commit\error_handler.py", line 46, in error_handler
yield
File "C:\Python36\lib\site-packages\pre_commit\main.py", line 294, in main
return run(args.config, store, args)
File "C:\Python36\lib\site-packages\pre_commit\commands\run.py", line 293, in run
return _run_hooks(config, hooks, args, environ)
File "C:\Python36\lib\site-packages\pre_commit\commands\run.py", line 214, in _run_hooks
retval |= _run_single_hook(classifier, hook, args, skips, cols)
File "C:\Python36\lib\site-packages\pre_commit\commands\run.py", line 124, in _run_single_hook
tuple(filenames) if hook.pass_filenames else (),
File "C:\Python36\lib\site-packages\pre_commit\repository.py", line 100, in run
return lang.run_hook(self, file_args)
File "C:\Python36\lib\site-packages\pre_commit\languages\docker.py", line 99, in run_hook
cmd = docker_cmd() + entry_tag + cmd_rest
File "C:\Python36\lib\site-packages\pre_commit\languages\docker.py", line 80, in docker_cmd
'-u', '{}:{}'.format(os.getuid(), os.getgid()),
AttributeError: module 'os' has no attribute 'getuid'
The same hook works fine in Windows Subsystem for Linux.
The text was updated successfully, but these errors were encountered:
makes sense, I haven't been able to get testing for docker on windows set up just yet -- not sure what the right thing to put for that argument is to be honest. The current support suggests only macos and linux for now
I'd be open to a patch if you'd like to get one working!
docker_cmd
in languages/docker.py usesos.getuid()
andos.getgid()
that don't exist in Python on Windows.A hook that uses Docker on Windows fails to execute with
The same hook works fine in Windows Subsystem for Linux.
The text was updated successfully, but these errors were encountered: