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
{{ message }}
Repository navigation
Git.AutoInterrupt.__del__() OSError: [WinError 6] The handle is invalid #935
I'm getting this error on the multiple windows machines I've tested this on. I'm working on an open source project, so it should be relatively easy to reproduce although I'm not sure on how easy it'd be to fix.
Setting up challenge: "intro commits"
Setup complete
Type "git gud instructions" to view instructions
Executed successfully
Exception ignored in: <function Git.AutoInterrupt.__del__ at 0x0000015DE3031798>
Traceback (most recent call last):
File "c:\Users\benth\Miniconda3\envs\git-gud\lib\site-packages\git\cmd.py", line 365, in __del__
if proc.poll() is not None:
File "c:\Users\benth\Miniconda3\envs\git-gud\lib\subprocess.py", line 966, in poll
return self._internal_poll()
File "c:\Users\benth\Miniconda3\envs\git-gud\lib\subprocess.py", line 1216, in _internal_poll
if _WaitForSingleObject(self._handle, 0) == _WAIT_OBJECT_0:
OSError: [WinError 6] The handle is invalid
Exception ignored in: <function Git.AutoInterrupt.__del__ at 0x0000015DE3031798>
Traceback (most recent call last):
File "c:\Users\benth\Miniconda3\envs\git-gud\lib\site-packages\git\cmd.py", line 365, in __del__
if proc.poll() is not None:
File "c:\Users\benth\Miniconda3\envs\git-gud\lib\subprocess.py", line 966, in poll
return self._internal_poll()
File "c:\Users\benth\Miniconda3\envs\git-gud\lib\subprocess.py", line 1216, in _internal_poll
if _WaitForSingleObject(self._handle, 0) == _WAIT_OBJECT_0:
OSError: [WinError 6] The handle is invalid
How to reproduce:
git clone git@github.com:bthayer2365/git-gud.git # or fork it!
cd git-gud
git checkout 4fe87dcdc56fe7cee8924663bef694b8e6c8ecc2
pip install -e .
cd ..
mkdir test
cd test
python -m gitgud start # Error occurs here
git gud load intro # Error occurs here
python -m gitgud start calls the same function that git gud load intro does.
I'm working on this. It seems that the easy fix is to just wrap proc.poll() in a try/except. I'm not sure if that's what you'd want. The harder part is adding a test. My situation seems to be particular and testing for the issue might be complicated. If you're okay with it, I'd like to submit a PR with this simple solution and no test.
@bthayer2365 Thanks for posting the fix, and I absolutely agree that in this case, a test will be difficult to produce given the specificity of the issue. The log will help to get some sort of hint why it is what it is, in case it poses problems to some in future.
Thanks a lot for contributing :)!
v3.0.4 was released yesterday, and I would collect a few more fixes before releasing v3.0.5. If things are pressing on your end, please let me know and I can certainly v3.0.5 early.
Nothing too pressing for me, everything works, just get that ugly-looking error message every time. Many users will have no idea about the issue anyways, but it'll be fixed as soon as you release this fix, and then I'll just add the requirement that GitPython be >= v3.0.5
Hi @Byron I'm at the point where I want to start advertising Git Gud to more people. It would be great if this bug was fixed when people installed it. Could you push v3.0.5?
Activity
Byron commentedon Oct 15, 2019
Thanks for posting, and for making it easy to reproduce for those with access to a windows machine.
Personally I am not among them, but hope that those with a similar issue can chime in to help get this resolved.
benthayer commentedon Oct 22, 2019
I'm working on this. It seems that the easy fix is to just wrap
proc.poll()in a try/except. I'm not sure if that's what you'd want. The harder part is adding a test. My situation seems to be particular and testing for the issue might be complicated. If you're okay with it, I'd like to submit a PR with this simple solution and no test.Here are links to the diffs:
master...bthayer2365:WinError6
master...bthayer2365:WinError6_test
The WinError6 branch solves the problem, but the WinError6_test branch is very much incomplete.
Byron commentedon Oct 23, 2019
@bthayer2365 Thanks for posting the fix, and I absolutely agree that in this case, a test will be difficult to produce given the specificity of the issue. The log will help to get some sort of hint why it is what it is, in case it poses problems to some in future.
Thanks a lot for contributing :)!
benthayer commentedon Oct 23, 2019
Great, glad we're on the same page! Thanks for merging. May I ask when I can expect to see this in a release?
Byron commentedon Oct 24, 2019
v3.0.4 was released yesterday, and I would collect a few more fixes before releasing v3.0.5. If things are pressing on your end, please let me know and I can certainly v3.0.5 early.
benthayer commentedon Oct 24, 2019
Nothing too pressing for me, everything works, just get that ugly-looking error message every time. Many users will have no idea about the issue anyways, but it'll be fixed as soon as you release this fix, and then I'll just add the requirement that GitPython be >= v3.0.5
benthayer commentedon Nov 13, 2019
Hi @Byron I'm at the point where I want to start advertising Git Gud to more people. It would be great if this bug was fixed when people installed it. Could you push v3.0.5?
Byron commentedon Nov 14, 2019
@bthayer2365 Thanks for the nudge :) - it's done, and v3.0.5 was just released to PyPi. The best of success!
When ready, feel free to add Git Gud to the list of projects that use GitPython in this repository's README file.
benthayer commentedon Nov 14, 2019
@Byron thank you! You already merged the PR with my project, so we should be good!