gearbox gevent calls patch_all when the server is started, so it might be that it fails if somehow modules are imported before starting the server. I'll double check this, in case it's confirmed it might be possible to solve it with just a new gearbox release.
What I can suggest is checking that you are not importing urllib or thread anywhere in the "config" package of your application, it's the first thing that gets loaded. On Thu, Oct 17, 2013 at 12:00 AM, Juraj Variny <[email protected]> wrote: > When added monkey.patch_all() directly on the top of gearbox, the problem > vanished. So it seems gearbox is monkey patching too late - urllib2 is > already imported somewhere and gevent then fails to patch it, as hinted by > this: https://groups.google.com/forum/#!topic/gevent/JUWbFMcNYEM > > Should I create an issue for this? > > Juraj > > > On Wednesday, October 16, 2013 11:37:18 PM UTC+2, Juraj Variny wrote: >> >> Hello, after upgrade to tg 2.3 and set up to use gevent, I am getting >> exceptions like: >> >> AssertionError: The object popped (<tg.wsgiapp.RequestLocals object at >> 0x4f12aa0>) is not the same as the object expected >> (<tg.wsgiapp.RequestLocals object at 0x4cbc398>) >> >> It happens in controller methods that make inline remote JSONRPC calls >> using jsonrpc-1.2 (which is based on standard urllib2) so I suspect it >> isn't monkey patched properly . Trying gevent 1.0rc3 did not help. I don't >> know how to tackle the problem, do you have any ideas please? >> > -- > You received this message because you are subscribed to the Google Groups > "TurboGears" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/turbogears. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "TurboGears" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/turbogears. For more options, visit https://groups.google.com/groups/opt_out.

