Hi all --

  I've just run across a bug in the GtkScrolledWindow class,
present in both 0.6.9 and 0.6.11 of pygtk.  The bug is that
the __getattr__ function uses a local "attrs" dictionary,
and looks for keys in it using "attrs.has_attr", which fails --
it should be "attrs.has_key".

  I was going to report this in bugzilla, but I'm not sure if
it's present in 2.x, and I'm not sure if 0.6.x development is 
ongoing or not, although I did notice that bugzilla has a 
"0.6.x" option for bug searches.  

  Locally, we have a work-around, so it's not a show-stopper
for us, but on the off-chance that this has propagated in 
surprsing ways, I thought I'd mention it.


  Here is the problem GtkScrolledWindow routine:

> def __getattr__(self, attr):
>         attrs = {
>                 'hscrollbar': _gtk.gtk_scrolled_window_get_hscrollbar,
>                 'vscrollbar': _gtk.gtk_scrolled_window_get_vscrollbar
>         }
>         if attrs.has_attr(attr): 
                   ^^^^^^^^ should be "has_key"
>                 return _obj2inst(attrs[attr](self._o))
>         else:
>                 return GtkBin.__getattr__(self, attr)


                                -- A.
-- 
Dr. Andrew C. E. Reid, Guest Researcher 
Center for Theoretical and Computational Materials Science
National Institute of Standards and Technology, Mail Stop 8500
Gaithersburg MD 20899 USA
[EMAIL PROTECTED]
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to