IRC log of #zope for Monday, 2012-08-27

*** evilbungle has joined #zope00:02
*** kiorky has quit IRC00:27
*** J1m has quit IRC00:39
*** kiorky has joined #zope00:44
*** J1m has joined #zope00:52
*** J1m has quit IRC01:06
*** evilbungle has quit IRC01:07
*** evilbungle has joined #zope01:18
*** motto has quit IRC01:21
*** evilbungle has quit IRC01:21
*** m8 has joined #zope01:22
*** m8 has quit IRC01:33
*** _mup_ has quit IRC03:00
*** _mup_ has joined #zope03:00
*** mr_jolly has quit IRC04:21
*** KageSenshi has joined #zope04:30
*** KageSenshi has quit IRC04:37
*** KageSenshi has joined #zope04:44
*** kosh has quit IRC05:25
*** KageSenshi has quit IRC05:42
*** KageSenshi has joined #zope07:43
*** tisto has joined #zope08:57
*** zagy_ has joined #zope09:11
*** yvl has joined #zope09:12
*** zagy_ has quit IRC09:12
*** zagy has joined #zope09:13
*** mr_jolly has joined #zope09:33
*** MrTango has joined #zope09:51
*** miano has joined #zope09:53
*** avoinea has joined #zope10:06
*** agroszer has joined #zope10:18
*** agroszer has quit IRC10:25
*** siebo has joined #zope10:26
*** zagy has quit IRC10:31
*** eperez has joined #zope10:32
*** zagy has joined #zope10:36
*** zagy has joined #zope11:09
*** maurits has joined #zope11:52
*** sunew has joined #zope12:14
*** evilbungle has joined #zope12:43
*** giacomos has joined #zope12:50
*** evilbungle has quit IRC13:05
*** mr_jolly_ has joined #zope13:16
*** mr_jolly has quit IRC13:16
*** mr_jolly_ is now known as mr_jolly13:16
*** tisto_ has joined #zope13:46
*** tisto has quit IRC13:50
*** agroszer has joined #zope13:51
*** fdrake has quit IRC14:08
*** kosh has joined #zope14:18
*** zr has joined #zope14:34
zrhello, I'd like to know how I can setup a security declaration for my BrowserView, so I can access self.context in my view method without raising a ForbiddenAttribute error14:35
zrI've browsed around but I have not yet found a document that explains this for my use case14:36
mgedminzr, you don't want security declarations for the view, you want security declarations for the context object14:42
mgedminself is never security proxied, so self.anything is always allowed14:42
mgedminbut a view's self.context is always security proxied, so self.context.anything till trigger a security check according to the declarations made for your context class14:43
zrmgedmin: thanks for clearing that up, so I would need a security declaration for the folderish object that is the context of the view?14:43
mgedminyes14:43
zrhmmm14:44
*** tisto_ is now known as tisto|lunch14:48
*** benji has joined #zope15:00
*** menesis has joined #zope15:04
zrmgedmin: I've been reading the api docs but I'm having problems grokking the concept behind it. Could you provide an example on how to do this?15:06
mgedminhow to do what, exactly?15:11
zrmgedmin: nevermind, I'll just use zope.security.proxy.getObject for now15:20
zrthanks anyway15:20
mgedminremoveAllProxies() is idiomatic15:20
zrmgedmin: right, thanks15:21
mgedminnaked_context = zope.proxy.removeAllProxies(self.context)15:21
mgedminalthough maybe zope.security.proxy.removeSecurityProxy(self.context) would be better15:22
mgedminoh, hey, it's actually an alias for getObject, but with a more descriptive name15:22
zrmgedmin: hehe15:22
zrmgedmin: do you know where I could introspect the paste httpserver threads? this information should be stored in the environ object of a wsgi application15:23
zrmy hope is that, by acquiring a handle on the context, I could traverse to it15:23
mgedminI'm confused by your question15:24
*** fdrake has joined #zope15:24
zrbasically I want to introspect the threads created by paste15:25
mgedminthe wsgi_env['paste.httpserver.thread_pool'] is a dictionary from thread_id to a tuple (time_started, request_info)15:26
mgedminrequest_info is either None or a wsgi dictionary of the request that that thread is currently handling15:27
*** fdrake has quit IRC15:27
mgedmindoes that help?15:27
zrnice, I can then use threadframe to get a list of threads15:27
mgedminthreading.enumerate()15:28
mgedminwhat15:28
mgedminerr, what's threadframe?15:28
zrthreadframe is a third party library15:28
zrbut I never tried threading.enumerate15:28
mgedminheh, threadframe's page says "Note: threadframe is obsolete. Python 2.5 and later include a function sys._current_frames() that does the same thing. Threadframe is only useful for Python 2.2 through 2.4."15:29
zrmgeadmin: err...15:29
mgedminsys._current_frames() is awesome15:29
zrmgedmin: thanks for the pointers15:30
mgedminI built a web page that shows me the current status of all my threads, including their stack traces and a list of the last N logging messages recorded in each thread15:30
mgedminit was already helpful chasing down deadlocks when I tried to use storm/postgresql and ZEO in the same app15:30
*** fdrake has joined #zope15:31
zrmgedmin: very cool!15:31
*** polysix has quit IRC15:35
zr915:35
zrbut then again, how do I get a handle on wsgi_env?15:40
mgedminif you've a zope request handy, it's request.environ15:41
mgedminsorry15:41
mgedminrequest._environ15:42
mgedminthis assumes that you're deploying zope through wsgi15:42
mgedminwhich you are, if you're using paste.httpserver :)15:42
zraargh15:42
zrI never needed to get the context...15:42
zrall I needed was self.request._environ15:43
zrI thought I had checked self.request thorougly using pdb15:44
*** polysix has joined #zope15:48
*** polysix has quit IRC15:53
*** benji has quit IRC15:55
*** benji has joined #zope15:57
zrmgedmin: thanks again for your help15:58
*** polysix has joined #zope15:58
*** les_sylvains has joined #zope16:02
*** eperez has quit IRC16:06
*** evilbungle has joined #zope16:10
*** sp0cksbeard has joined #zope16:16
*** evilbungle has quit IRC16:19
*** J1m has joined #zope16:25
*** evilbungle has joined #zope16:33
*** evilbungle has quit IRC16:46
*** etaylor has joined #zope16:56
*** mr_jolly has quit IRC16:59
*** les_sylvains has quit IRC17:04
*** dayne1 has quit IRC17:11
*** siebo has quit IRC17:13
*** eperez has joined #zope17:22
*** kosh has quit IRC17:24
*** J1m has quit IRC17:29
*** J1m has joined #zope17:30
*** tisto|lunch is now known as tisto17:41
*** les_sylvains has joined #zope17:51
*** sunew has quit IRC18:17
*** supton has joined #zope18:22
*** J1m has joined #zope18:35
*** les_sylvains has quit IRC18:46
*** agroszer has quit IRC18:47
*** elro has joined #zope18:54
*** menesis has quit IRC18:59
*** elro has quit IRC18:59
*** giacomos has quit IRC19:15
*** tisto has quit IRC19:18
*** zr has quit IRC19:21
*** avoinea has quit IRC19:42
*** les_sylvains has joined #zope19:45
*** tiwula has joined #zope19:48
*** sm has quit IRC19:54
*** sm has joined #zope19:55
*** maurits has quit IRC20:00
*** jham has joined #zope20:02
*** MrTango has quit IRC20:06
*** jham_ has quit IRC20:06
*** agroszer has joined #zope20:06
*** MrTango has joined #zope20:07
*** les_sylvains has quit IRC20:19
*** agroszer has quit IRC20:25
*** les_sylvains has joined #zope20:41
*** m8 has joined #zope20:42
*** m8 has quit IRC21:34
*** m8 has joined #zope21:35
*** AnneGilles has joined #zope21:56
*** MrTango has quit IRC23:02
benbangertJ1m: welp, gonna go pure Python in kazoo23:04
benbangertno more C binding or C lib23:04
J1mwhy?23:05
benbangertwe spent over a week debugging a a bug in the Python C binding23:06
benbangerthaving to track bugs through two layers of C is horrible23:06
benbangertthe C binding wasn't using the right password copy function, so if the server generated a byte password with a \0 character, the Python one got truncated23:06
benbangertand after looking through it some more, there's still remaining seg-fault bugs in the C binding and/or C lib itself23:07
benbangertit seems untenable to maintain a Zookeeper library unless you want to maintain/fix bugs in both the C binding and C lib23:07
J1mso you're going to write against the network protocol directly. Sounds like fun. ;)23:07
J1myeah, which sucks.23:07
benbangertits actually already done for the most part, https://github.com/maguro/pookeeper23:08
benbangertand its a super simple protocol, and implements new ZK 3.4 features as well23:08
J1mCan't say I like that name.23:08
benbangertI need to yank it in, it has some inefficiencies due to generated code23:08
benbangertyea, I'm going to extract the bits and have it integrated inside kazoo23:08
benbangertwhich is needed anyways to use the IHandler API for gevent compat23:08
benbangertbut the network protocol is simple, I can read all the Python code for it in 10 mins23:09
benbangertI can't read half the C binding in 10 mins23:09
benbangertand the C lib.... ergh23:09
J1mwow.23:09
J1mI didn't realize the network protocol was that simple.23:09
J1mcool.23:09
benbangertyea, its a breeze23:09
benbangertso kazoo gets to dump a bunch of the hacks to deal with the C lib thread23:10
benbangertand other edge case hacks that were due to the C lib23:10
J1mvery nice.23:10
benbangertand there's the 3.4 read-only feature which might be handy for you23:10
J1mand zc-zookeeper-static can die!23:10
benbangertin a partition event, you can remain connected and go into read-only mode23:10
J1mcool (I assumed that how it worked already :)23:11
benbangertnah, in a partition event, you'll get dropped23:11
benbangertand Zookeeper will only let you connect if its part of a consensus23:11
*** les_sylvains has quit IRC23:20
*** AnneGilles has quit IRC23:24
*** les_sylvains has joined #zope23:33

Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!