ZPatterns alpha 3 released (was re: ZPatterns 0.4.0a2 bug fixes)
At 11:54 AM 6/20/00 +0300, Itamar Shtull-Trauring wrote:
"Phillip J. Eby" wrote:
* The missing _objectChanged() message - it was very hard to track down, because everything appeared to be working right, except for the fact that it wasn't working. Turns out that _v_status_ (the variable, not the method) was an empty string. Which meant that what looked like self.__dict__['_v_status_'] in code was actually self.__dict__[''].
Now I'm having problems with changing objects -
Error Type: KeyError Error Value: _v_status_ .. File /home/Zope2/lib/python/Products/ZPatterns/DataSkins.py, line 192, in __set_attr__ File /home/Zope2/lib/python/Products/ZPatterns/DataSkins.py, line 137, in _objectChanging KeyError: (see above)
As far as I can tell _v_status_ is not initialized at any point, which is what causes the problem.
Huh? Oh, %()@&%... I fixed that in my working copy, but didn't check it into CVS before building a release .tgz yesterday... Argh. Line 137 of DataSkins.py *should* read: if self._v_status_ is not ChangedStatus: Sorry, everyone. I've checked in this fix, along with the one for Mike's "missing _v_dm_" problem, and uploaded an alpha3 release.
"Phillip J. Eby" wrote:
Huh? Oh, %()@&%... I fixed that in my working copy, but didn't check it into CVS before building a release .tgz yesterday... Argh. Line 137 of DataSkins.py *should* read:
if self._v_status_ is not ChangedStatus:
Sorry, everyone. I've checked in this fix, along with the one for Mike's "missing _v_dm_" problem, and uploaded an alpha3 release.
Thank you, Phillip. I've spent all the evening hunting these bugs. By the way, how do you debug? Is there better way than inserting things like print "objectChanging %s, has status=%d" % ( self, self.__dict__.has_key('_v_status_') ) :-) Mike
At 10:25 PM 6/20/00 +0800, mike wrote:
"Phillip J. Eby" wrote:
Huh? Oh, %()@&%... I fixed that in my working copy, but didn't check it into CVS before building a release .tgz yesterday... Argh. Line 137 of DataSkins.py *should* read:
if self._v_status_ is not ChangedStatus:
Sorry, everyone. I've checked in this fix, along with the one for Mike's "missing _v_dm_" problem, and uploaded an alpha3 release.
Thank you, Phillip. I've spent all the evening hunting these bugs. By the way, how do you debug? Is there better way than inserting things like
print "objectChanging %s, has status=%d" % ( self, self.__dict__.has_key('_v_status_') )
I haven't found one yet. I'm actually using zLOG.LOG calls, however, to a logfile, so I can look back at things easily (and because I didn't realize you could use print until you posted this... :) ).
On Tue, 20 Jun 2000 09:46:34 -0500 "Phillip J. Eby" <pje@telecommunity.com> wrote: [snip]
Thank you, Phillip. I've spent all the evening hunting these bugs. By the way, how do you debug? Is there better way than inserting things like
print "objectChanging %s, has status=%d" % ( self, self.__dict__.has_key('_v_status_') )
I haven't found one yet. I'm actually using zLOG.LOG calls, however, to a logfile, so I can look back at things easily (and because I didn't realize you could use print until you posted this... :) ).
I recommend pdb; there's a How-To klm wrote on the zope.org site called 'Debugging Zope Python Code', that recommends inserting something like import pdb pdb.set_trace() at the part of the code that you want to have it drop down into the debugger at, and then you can step through and find out the value of various expressions as you're running things, call functions, etc. Mr. Creosote is also my favorite - check out the MrCreosote subdirectory of pcgi/ in your Zope installation; the nice thing about Mr. Creosote is you can have it send debugging info to another machine (UDP packets) --Brian Hooper
Huh? Oh, %()@&%... I fixed that in my working copy, but didn't check it into CVS before building a release .tgz yesterday... Argh. Line 137 of DataSkins.py *should* read:
Great, it works! Thanks for all the wonderful work, Phillip. -- Itamar S.T. itamar@maxnm.com Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C
At 05:49 PM 6/20/00 +0300, Itamar Shtull-Trauring wrote:
Huh? Oh, %()@&%... I fixed that in my working copy, but didn't check it into CVS before building a release .tgz yesterday... Argh. Line 137 of DataSkins.py *should* read:
Great, it works!
Tell me, were you able to use GenericTrigger(s) to do the cataloging? It might be more convenient to update/modify than your cataloging-specific Agent class. Also, I noticed that your getMemento routine saves the object's __dict__, but that's of absolutely no value whatsoever, since the __dict__ is a mutable object and will thus have been changed by the time you get the commit-time messages.
participants (4)
-
Brian Takashi Hooper -
Itamar Shtull-Trauring -
mike -
Phillip J. Eby