Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Issues with AutoInterrupt in conjunction with sys.exit on python 3.5 #463
Comments
|
I recall from reading another isssue that the problem is that the process object is not being deleted Looking at the code it looks like the fix is to explicitly del the process object once it is no longer needed. This bug I suspect may happen on py2 depending on garbage collector config. for example from cmd.py:965:
should be something along these lines:
|
Byron
added
the
waiting for feedback
label
Jun 14, 2016
|
Which version of GitPython are you using ? It doesn't appear to be the latest one. |
|
Closed due to inactivity. Please comment to get the issue reopened. |
Byron
closed this
Jul 23, 2016
|
Byron, Unless you fixed the code this bug is still present in the code base. Barry |
|
@barry-scott Can you please answer the question in my last comment, or maybe even provide a test that triggers the issue to allow it to be fixed ? Otherwise this one would be open forever, and I try to avoid that. Thank you. |
|
And I just noticed that you have not been the OP, yet it seemed you have information about the issue that might help resolving it. |
|
What I recall is that I noticed is the with python2 as soon as the object owning a process resource goes out of scope its is deleted. But in python3 the delete is delayed because of changes in garbage collection. For example line 635 in cmd..py returns an instance of AutoInterrupt. All caller will have to be changed to del the returned object after use. Unless this code change has been made this bug remains unfixed. |
Byron
reopened this
Aug 2, 2016
Byron
added
acknowledged
and removed
waiting for feedback
labels
Aug 2, 2016
|
Thanks @barry-scott, I understand. It seems a context manager for the |
Byron
added this to the v2.0.8 - Bugfixes milestone
Aug 2, 2016
Byron
added
the
help wanted
label
Aug 2, 2016
|
I'm pondering if the cmd code should be ripped out and replaced en-mass. We now know that it needs to:
I think that the above features for cmd can be implemented in a smaller and more obvious way (I wish you would setup a mailing list for GItPython to allow discussions) |
|
@barry-scott I believe you are right - the code has been growing just to accommodate all the needs as they arose. This will eventually erode clarity unless some major refactoring or even a rewrite is done. A good starting point would be to clearly separate the orthogonal parts. Something that comes to mind immediately is the part that streams objects through the git process (a hash goes in, an object comes out, the process is held alive permanently). Another obvious step could be to remove all reliance on the destructors and use context-managers or something like an idempotent On the bright side, one can stake small steps in this endeavour, knowing that the massive reliance on the implementation will show any issues right away when running the tests, some of which might have to be adjusted at some point. In any case, I find it most important to at most deprecate old parts of the API, so that existing clients have time to adjust. Ideally, they won't even have to, as many will just use it as a simple call wrapper. When reading through the list of bullet points, one seems to be new in particular: This project had a mailing list before, and I closed it just because there was nothing happening. By now I do prefer using issues on github for all public communication. If you wish to go ahead with certain refactorings or improvements, you could open an issue for them and discuss the details there. Even though the process is not well defined, we will figure something out as we go, there isn't too many people active on this project after all. I hope that will work for you, as your contributions are greatly appreciated. |
Byron
modified the milestones:
v2.0.8 - Bugfixes,
v2.0.9 - Bugfixes
Aug 3, 2016
|
On windows git credentials wincred prompts using the terminal stdin/stdout. I am working on a prototype of the process control and filtering the work is in: Its currently code is python3 only and the windows version is not sane. The macos/linux version is showing promise. python3 git_cmd.py git status Barry
|
|
Thanks for the heads-up. Looking at the code, I didn't see the usage of |
|
GIT_ASKPASS is half a solution. I could write a stub that using a named pipe to ask the main GUI for the answers. But that means the GUI must implement the credential storage. I guess I can figure out what git-credentials-wincred.exe does and fake being it. |
|
I strongly believe |
|
Yes you are right the credentials are stored after askpass returns them. I should have this askpass stuff integrated into scm woekbench soon. Barry
|
|
@barry-scott you may take a fresh look at code after some major Windows issues have been resolved in #519 and remaining ones are marked for #525. |
|
@ankostis thanks for the heads up. I will test against trunk and check for regressions. |
Byron
modified the milestones:
v2.0.9 - Bugfixes,
v2.0.10 - Bugfixes,
v2.1.0 - proper windows support,
v2.1.0 - better windows support,
v2.1.1 - Bugfixes
Oct 16, 2016
ankostis
added
waiting for feedback
and removed
help wanted
labels
Oct 27, 2016
Byron
modified the milestones:
v2.1.1 - Bugfixes,
v2.1.2 - Bugfixes
Dec 8, 2016
Byron
modified the milestones:
v2.1.2 - Bugfixes,
v2.1.3 - Bugfixes
Mar 8, 2017
|
I am closing this issue as it had no interaction for more than 3 months. Please feel free to comment in case you need it to be reopened. |
Heiko-san commentedJun 6, 2016
•
Edited 1 time
-
Heiko-san
Jun 6, 2016
The destructor of the cmd class (actually AutoInterrupt) seems to throw some errors using python 3.5 on Arclinux:
It seems this error is triggered by a call to sys.exit(0) at the end of my script, since it doesn't appear if I comment it out.
However I couldn't reproduce this behavior with python 2.7, here sys.exit(0) seems to be working with the module correctly.
What I do is simply clone a repo, add some files commit and push them to a remote.