[Sugar-devel] [PATCH] Don't crash on invalid favoriteslayout settings

Bernie Innocenti bernie at codewiz.org
Sat May 15 11:42:31 EDT 2010


El Wed, 05-05-2010 a las 17:46 +1000, James Cameron escribió:
> On Tue, May 04, 2010 at 07:22:36PM -0400, Bernie Innocenti wrote:
> > This could happen if the user upgrades Sugar to a new version which
> > doesn't support the old layout.
> > 
> > Signed-off-by: Bernie Innocenti <bernie at codewiz.org>
> 
> I figured out you're patching 0.84, 'cause the line numbers didn't match
> unless I was looking at 0.84.  ;-)
> 
> While this is one fix, perhaps it would be better to pick the patch that
> made it into later versions.  See bf2296f from 2009-09-16 (ticket #1147)
> which changes FavoritesView._set_layout from this:
> 
>     def _set_layout(self, layout):
>         if layout not in LAYOUT_MAP:
>             raise ValueError('Unknown favorites layout: %r' % layout)
> 
> to this:
> 
>     def _set_layout(self, layout):
>         if layout not in LAYOUT_MAP:
>             logging.warn('Unknown favorites layout: %r' % layout)
>             layout = favoriteslayout.RingLayout.key
>             assert layout in LAYOUT_MAP

Since there's already a fix in 0.88, I withdraw my own patch.

Sayamindu, you might still want to apply bf2296f to the 0.84 branch.

-- 
   // Bernie Innocenti - http://codewiz.org/
 \X/  Sugar Labs       - http://sugarlabs.org/



More information about the Sugar-devel mailing list