-
Notifications
You must be signed in to change notification settings - Fork 9
Unable to use GitPython with Gevent. #1
Comments
This is a pretty serious issue. If anything there should be at least an option to use GitPython without async. |
I agree ! Async was a bit of a silly idea, considering pythons GIL 'issue'. Even though one can workaround that with custom c-python modules, its somewhat difficult to distribute it properly. In the last line, you see that it can't instantiate a lock, as it for some reason expects an argument. However, you ware free to plugin in your own LockCls by patching it with a wrapper which initializes the lock you have accordingly. Doing so will not be trivial, as you need to get to async before gitpython does. Obviously, gitpython will initialize it, so you would have to add async to the sys.path yourself and import and patch it. Removing async entirely from gitpython isn't that hard, but it would certainly take more than just a quick session, so monkeypatching it seems to be the best choice for now. |
…ntended conversion of Lock to a staticmethod.
This bug isn't actually related to gevent at all, rather it is an inadvertent bug in how async.pool is using threading.Lock. The problem is that threading.Lock is not actually a class (per 2.7), and therefore in pool.py in ThreadPool, this line:
is actually creating an unbound method. Thus, in practice when async tries to instantiate the lock "class" object via:
what it is actually doing is calling threading.Lock() with a self argument (a ThreadPool install). Trivial fix here: |
The fix seems to do the trick for me, thanks!. Why hasn't it been PRed to main async repo? |
+1 to get this fix pulled |
+1 requesting as well. |
I thought I did but I guess I just never sent it. Done! |
+1 for getting the fix. |
I believe this is fixed, latest version of async was pushed to pypi. |
Hi, I'm trying to use GitPython in a gevent project and it would seem that I am unable to.
Here is an example of the problem.
Thanks,
Dan
The text was updated successfully, but these errors were encountered: