[Zope-dev] zope photo product 0-4-3 bug and fix.

Dr. Ross Lazarus rossl@med.usyd.edu.au
Mon, 19 Jun 2000 19:33:45 +1000


I think I just squished a subtle and extremely annoying bug in 0.4.3 of
the photo product at http://yyy.zope.org/Members/Drew/Photo

Making a copy of display_defaults by a dictionary copy in the __init__
method is a Bad Thing because (shallow) copy doesn't copy substructures
- it makes them all point to the same place. 

Fix = import the copy module and use copy.deepcopy(display_defaults) at
initialisation: ie replace 

	    self.displays=display_defaults.copy()

with

            self.displays=copy.deepcopy(display_defaults) # was
display_defaults.copy()