IRC log of #zope3-dev for Wednesday, 2005-01-12

*** J1m has quit IRC00:06
*** SteveA has joined #zope3-dev00:47
*** J1m has joined #zope3-dev00:53
*** SteveA has quit IRC01:07
*** stub has joined #zope3-dev01:14
*** zagy has quit IRC01:14
*** benji_york has quit IRC01:43
*** bskahan has quit IRC01:44
*** BradB has quit IRC02:09
*** J1m has quit IRC02:10
*** paolo has joined #zope3-dev02:13
*** paolo has quit IRC02:37
*** jhauser_ has quit IRC02:41
*** mooded has quit IRC03:21
*** stub has quit IRC04:19
*** stub has joined #zope3-dev04:20
*** RaFromBRC has joined #zope3-dev04:56
*** RaFromBRC has quit IRC05:15
*** Suresh-E has joined #zope3-dev06:15
*** BradB has joined #zope3-dev06:27
*** bskahan has joined #zope3-dev06:54
*** tvon has quit IRC08:08
*** tvon has joined #zope3-dev08:08
*** sashav has quit IRC09:15
*** hdima has joined #zope3-dev09:18
*** stub has quit IRC09:34
*** Damascene has quit IRC09:36
*** bskahan has quit IRC09:41
*** agenteo has joined #zope3-dev09:47
*** stub has joined #zope3-dev10:00
*** sashav has joined #zope3-dev10:20
*** zagy_ has joined #zope3-dev10:30
*** mgedmin has joined #zope3-dev11:14
*** MalcolmC has joined #zope3-dev11:14
*** mgedmin has quit IRC11:14
*** SteveA has joined #zope3-dev11:14
*** Aiste has left #zope3-dev11:19
*** mgedmin has joined #zope3-dev11:51
*** mooded has joined #zope3-dev11:54
*** J1m has joined #zope3-dev12:31
*** kaczordek has joined #zope3-dev12:48
*** paolo has joined #zope3-dev13:20
*** agenteo has quit IRC13:22
*** u has joined #zope3-dev13:28
*** u is now known as vlado13:30
*** Voblia has joined #zope3-dev13:44
*** kaczordek has quit IRC13:47
*** mgedmin_ has joined #zope3-dev14:44
*** mgedmin has quit IRC14:44
*** mgedmin_ is now known as mgedmin14:44
*** J1m has quit IRC14:49
*** mooded has quit IRC14:51
*** Suresh-E has left #zope3-dev15:04
*** Voblia has quit IRC15:27
*** Voblia has joined #zope3-dev15:27
*** agenteo has joined #zope3-dev15:34
*** apoirier has joined #zope3-dev15:42
*** regebro has joined #zope3-dev15:51
regebroHiya! I just hit a confusing "snag" with zcml on X3.0.0.15:52
regebroIn a case where I try to reference an interfaces.py with ".interfaces" I got the error message that the module did not have a global "interfaces".15:52
regebroThe problem was that there was an error in interface.py which prevented it from being imported.15:53
regebroI quickly suspected that this was the problem, but it does become slightly tricky to debug.15:53
regebroWould it be possible to get a better error message in that case?15:54
*** BradB has quit IRC16:04
srichterregebro: yeah, I have noticed this problem many times before16:05
srichterregebro: it is definitely possible to improve the error message, but it will need some work in zope.configuration16:06
srichterbeascially what fails is the field conversion from a string to a Python object16:06
srichterI bet you the configuration code just generically calls these conversion errors; if so there needs to be a special handler for syntax or import errors16:06
regebrosrichter: Cool. I couldn't find a collector issue for it. Should I create one? Or maybe you, since you obviously know more about the issue?16:08
srichterregebro: please create one16:08
*** BradB has joined #zope3-dev16:09
regebroDone. http://zope.org/Collectors/Zope3-dev/34816:19
*** mooded has joined #zope3-dev16:20
srichterthanks16:24
*** regebro is now known as regebro-lunch16:30
*** AJC has quit IRC16:45
*** Damascene has joined #zope3-dev16:58
*** stub has quit IRC17:13
*** regebro-lunch is now known as regebro17:14
*** tvon has quit IRC17:17
*** Voblia has quit IRC17:18
*** tav_ has joined #zope3-dev17:31
*** hdima has quit IRC17:36
*** tav has quit IRC17:46
*** tvon has joined #zope3-dev17:53
*** J1m has joined #zope3-dev18:00
*** apoirier has quit IRC18:12
*** vlado has quit IRC18:24
*** AJC has joined #zope3-dev18:55
*** sashav has quit IRC18:58
AJCdoes it make sense to have all .css .jpg and other resources served by another server but zope?  there would be a faster turn around time with, say, twisted...19:01
Theunior even apache19:03
Theunifor images and css you could also use special squid rules19:03
AJCsquid?19:06
Theuniyou can use squid (a caching server / web proxy) to deliver those objects faster19:08
AJCok, cool.  so it does make sense!19:09
*** regebro has quit IRC19:09
*** Voblia has joined #zope3-dev19:16
*** mkerrin has joined #zope3-dev19:16
*** mohsen is now known as mohsen-away19:20
*** Voblia has quit IRC19:28
*** paolo has quit IRC19:32
*** Theuni has quit IRC19:36
*** MalcolmC has quit IRC19:41
srichterJ1m: are you there? Do you have a minute?19:54
*** __gotcha_ has joined #zope3-dev19:57
J1myes20:08
srichterJ1m: I have a problem with local roles/permissions20:11
srichterJ1m: some functional tests fail because the manager having the local manager role does not work20:11
srichterwhere should I start looking?20:12
*** __gotcha has quit IRC20:12
srichterzopepolicy.py?20:12
srichterJ1m: it must have something to do with my changes, since the tests clearly passed before20:13
J1mbrb20:15
srichterok20:15
srichterok, I think I got it20:16
srichterthe view does not have a parent, so it cannot find the role/permission settings20:17
J1mcool :)20:17
srichterwell, it kind of sucks20:18
srichterbecause no interface describes that20:18
srichterso if someone does not implement BrowserView they will not have a parent20:18
srichterand that means security will be broken20:18
J1mTrue20:18
J1mIt does kind of suck.20:18
J1mI'd like to get to  a point though where most adapters, including views are public20:19
J1mIf views are public, then this is not an issue.20:19
srichtermmh, interesting20:19
srichterright20:19
J1mThis is something I ramble on about toward the end of the current tutorial.20:20
J1mYou say: "view does not have a parent, so it cannot find the role/permission settings"20:20
J1mwhat does that mean?20:20
J1mIs it trying to acquire it?20:20
srichterwell, local roles are stored in persistent objects20:21
J1myes, so?20:21
srichterthe way local role and permission settings are found is by looking at the parent20:21
srichterfor example you want to do:20:21
srichtercheckPermission(myview, 'browserDefault')20:21
J1mOh, so you are trying to access a view20:22
srichteryes20:22
J1mand the view is proxied.20:22
srichteryes20:22
J1mright20:22
J1mI'll note that this doesn't happen very often.20:22
J1mWhat is trying to access the view?20:23
srichterusually only if someone implements their own __init__20:23
J1mHm?20:23
srichterother views tried to access that view20:23
J1mHow did they get it?20:23
srichterI dunno, it's a functional test20:23
J1mhm20:24
J1mI know this comes up some times.20:24
srichterand this sort of thing is very hard to detect too20:24
J1mI wonder why your changes would affect this20:25
srichterbecause getView always located the view20:25
srichterparent and name20:25
srichterohh, shoot20:26
srichterthere is even more trouble coming, because untrusted adapters need a location too20:26
J1mis the view in question one that wasn't defined via a page directive?20:26
srichterno, it used a page directive20:27
srichterbut it implemented its own __init__20:27
J1mwhy do untrusted adapters, which we don't have yet, need a location?20:27
srichterwhich overrides BRwoserView's version20:27
J1mah20:27
srichterI think I meant trusted ones (which ones are security proxied)20:27
J1mMy suggestion was to have the page directives create factories that called the view constructor and then set the parent and name.20:28
*** agenteo has quit IRC20:28
srichterright,...20:29
srichtermmh, oh, I just set the name20:29
J1mah20:29
srichterbecause I thought BrowserView was handling the parent20:29
srichterthe problem is that the page directives do not create factories, but new types20:30
srichterI guess I could create an additional base class :-(20:31
J1mThey use the new types as factories.20:31
*** BjornT has quit IRC20:31
J1mactually, you know the name at that point. You could just set the name as a class attribute20:32
srichterthat is what I am doing20:32
J1mwrt parent, you could make __parent__ a property that returns self.context20:32
srichterunless the context is not named self.context :-)20:33
srichterbut not a bad idea actually20:33
J1mIt has to be for pages20:33
srichtermaybe this is what bBrowserView does instead of directly setting it20:33
J1mAnything that has zpt *must* provide a context attr20:33
srichteroh, ok20:34
srichters/does/should do20:34
J1mwhere is BrowserView?20:34
srichterzope.app.publisher.browser __init__.py20:35
J1mI hate hiding code in __init__,py :)20:35
srichter:-)20:35
J1mIt sets it in the constructor20:35
srichterright20:35
J1mJust change it to use a property20:36
srichterwhich sometimes gets overridden20:36
srichteryep, will do that20:36
srichternow all hell is breaking loose :-)20:37
srichterI have to be a bit more clever I think20:38
J1mYou've been in hell for weeks now20:38
srichteryeah, I was looking forward to the decent to heaven20:38
srichterbut the devil pulls on me20:38
srichterok, this did not solve the entire problem20:42
srichterok, yipee, it seems fixed20:48
srichterok, only 12 ftests failures left20:49
* VladDrac 's back21:20
*** tvon has quit IRC21:21
*** RaFromBRC has joined #zope3-dev21:24
*** tav_ is now known as tav21:39
*** foom has joined #zope3-dev21:39
foomI've found what I think is a serious bug in zope.interface's AdapterRegistry21:40
foomhttp://rafb.net/paste/results/Vf1gl510.html21:40
foomit appears the issue is that adapter.Surrogate doesn't track changes in spec.__bases__21:41
*** d2m has quit IRC21:44
srichterfoom: can you make a unittest out of this?21:49
srichterbtw, are you coming to the Python meetup on Thursday?21:49
*** bskahan has joined #zope3-dev21:50
srichterit seems to be a bug of classImplementsOnly21:52
srichterI think we do not use this function in Zope at all, so it might be under-exposed and thus buggy21:52
foomNo I'm pretty sure it's a bug in Surrogate21:52
foomit sets __bases__ but doesn't ever change it in response to dirtying21:53
foomi dunno i'm not on python meetup mls. where is it?21:53
srichterTufts University21:53
srichteryou just take the T to Davis21:53
srichterSee who's coming and RSVP (it's not too late!):21:54
srichterhttp://python.meetup.com/48/events/3860264/21:54
srichterWhat: Boston Python January Meetup21:54
srichterWhen: Thursday, January 13 at 7:00PM21:54
srichterWhere: Tufts Physics Department21:54
srichterRobinson Hall 200 College Avenue21:54
srichterMedford MA 0215521:54
foomhm i have to go to springfield tomorrow after work, can't be there. :(21:58
srichterok21:59
srichterno problemo; it would have just a good oppurtunity to look at the bug together21:59
foomthis seems to fix it: http://rafb.net/paste/results/7RXCHU91.html22:03
*** tvon has joined #zope3-dev22:03
*** BjornT has joined #zope3-dev22:04
foomAlthough I really have no idea what's going on with this code, it's incredibly roundabout and complicated22:05
foomso that may or may not actually be correct. :)22:05
*** sashav has joined #zope3-dev22:07
J1mThat looks about right22:08
J1mAre you a contributor?22:08
foomno22:09
J1mOK, could you file a collector issue?22:09
foomhow?22:10
J1mhttp://collector.zope.org/Zope3-dev22:10
J1mWe never ran into this because be never modify interfaces or declarations at run time.22:11
J1mAn update to adapter.txt would be helpful too. :)22:11
foomyou never modify them at runtime? wow. you made an awful lot of framework for handling runtime modification and not even using it? :P22:12
J1mIf you have suggestions for making the code less roundabout and complicated, I'm open to suggestions.22:12
J1m<shrug>22:13
SteveAimplement it in C so that python programmers don't see it ;-)22:13
J1mI guess I was right to anticipate the need.22:13
foomyep22:13
SteveAworks for the "class" implementation in the python runtime ;-)22:13
foomIt's good that it's there. I'm just amazed that you implemented it without needing it22:14
J1mWe anticipate and have played with persistent interfaces22:14
J1mWhich obviously need it.22:15
srichterJ1m: might this fix our persistent interface problem?22:15
foomthat new user form could do with some error notification isntead of just taking you back to the form with no idea what happened.22:15
J1msrichter, no22:16
srichterok22:16
*** SteveA has quit IRC22:19
foomdone, http://collector.zope.org/Zope3-dev/34922:25
foomi'd like to request a bugfix release of zope-interface after the bug is fixed, too.22:25
J1mOK22:26
*** mgedmin has quit IRC22:31
*** mkerrin has quit IRC22:37
srichterJ1m: did you get anywhere today with your back-wardcompatibility discussion?22:40
*** RaFromBRC has quit IRC23:00
*** benji_york has joined #zope3-dev23:03
*** benji_york has joined #zope3-dev23:04
J1msrichter, yes23:23
VladDrachmm.. can't subscribe to zope3-checkins from gmail it seems, confirmation mail never arrived23:23
VladDracanyone seen this before?23:23
srichterJ1m: so you wanna share?23:23
srichter:-)23:23
J1msure23:24
J1mI'd like an api like:23:24
J1mdeprecate('foo', 'bar')23:24
J1mThis means that the names foo and bar in the current module are deprecated.23:25
J1mOr23:25
srichterI think it needs to be deprecate('foo', 'bar', explanation='some text')23:25
J1mdeprecatedModule(explanation)23:25
J1mok23:25
J1mdeprecate(('foo', 'bar'), explanation)23:26
srichteryes23:26
VladDracdecorators!23:26
J1mdeprecateNames(('foo', 'bar'), explanation)23:26
J1mno, no decorators23:26
J1mNow, these deprecation functions do the following:23:26
J1m1. Get the module name (__name__) from the calling frame.23:27
J1m2. Check to see if sys.modules[name] is a deprecated module.23:27
J1m3. If it is, then just add the names to the deprecated names for the module.23:28
J1m4. Otherwise, create a deprecated module of the current module with the given names (or for all names)23:28
J1mA deprecated module is a proxy of the original module with a __getattr__ that generates a warning whenever someone gets a deprecated attr.23:29
srichtersounds good to me23:29
J1mIn step 4, of course, the deprecated module gets stuffed into sys.modules.23:29
srichterthat should be easy to implement as well23:29
J1mYup, just needs an implementation.23:29
J1mfairly23:30
J1mTim and Fred didn't think it was unpythonic in any way.23:30
srichtergreat23:30
srichterI think this might work for class attributes as well23:31
J1mclass attributes should be handled using descriptors23:31
srichterright23:31
srichterwhere should the imlementation go?23:32
srichterzope.backward :-)23:32
J1mzope.deprecation?23:32
srichtersounds good23:33
srichterwhat about situations where we change a name?23:34
srichterlike IMyService becomes IMyUtility?23:34
srichterI think we should have a nice method for this too23:34
J1mthen the old name is deprecated.23:34
J1mWe aren't deprecating the object, we're deprecating the name23:34
srichteryes23:35
srichterso23:35
srichterMyService = MyUtility23:35
srichterdepcrecateName('MyService', 'explain')23:35
J1myup23:35
srichterok23:35
J1mBTW, can we stop putting "Utility" on the end of everything?23:36
srichterI wonder whether we should encode the deprecation date/time with it as well23:36
srichtersure23:36
srichterI found it awkward as well, but could not think of better names23:36
J1mThe release in which is goes away should be in the message23:36
srichterok23:36
J1mJust leave "Utility" off.23:36
srichterok23:37
*** benji_york has quit IRC23:41
srichterJ1m: what if an entire module is deprecated23:42
srichterfor example zope.app.utility23:42
srichterwhen I do `import zope.app.utility`, __getattr__ of zope.app is never called and the deprecation warning is not issued23:42
*** benji_york has joined #zope3-dev23:49
AJCare you guys still on Python 2.3.x or 2.423:56
Damascenepersonally 2.3.  i did a fresh activestate instal of 2.4 on another machien though. ;)23:57
AJCfor running Zope3 also?23:57
srichterAJC: there are only two tests failing with Py 2.4, which is an easy fix23:57
*** J1m has quit IRC23:58
AJCok, thanks for the info.23:58
AJCbtw, i've written a script for getting twisted to do the vhost redirection to zope instead of apache btw... still need to set everything up on the server ;)23:59
Damascenefor zope3, i use 2.3.423:59

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