Closed erilyth closed 8 years ago
Thanks for looking into this, can you provide a test case for reproducing this? I haven't being able to.
To reproduce the error, 1)Copy something to the clipboard 2)Drag from the clipboard to any place and release
Try this a few times and you will get the division by zero error in the log.
Ah yes, can reproduce. I also get at the same time:
Traceback (most recent call last):
File "/home/saam/sugar-build/build/out/install/lib/python2.7/site-packages/sugar3/graphics/animator.py", line 147, in _next_frame_cb
animation.do_frame(current_time, self._duration, self._easing)
File "/home/saam/sugar-build/build/out/install/lib/python2.7/site-packages/sugar3/graphics/animator.py", line 209, in do_frame
self.next_frame(frame)
File "/home/saam/sugar-build/build/out/install/lib/python2.7/site-packages/sugar3/graphics/palette.py", line 509, in next_frame
self._palette.set_palette_state(Palette.SECONDARY)
File "/home/saam/sugar-build/build/out/install/lib/python2.7/site-packages/sugar3/graphics/palettewindow.py", line 765, in set_palette_state
self._set_palette_state(state)
File "/home/saam/sugar-build/build/out/install/lib/python2.7/site-packages/sugar3/graphics/palette.py", line 450, in _set_palette_state
self.update_position()
File "/home/saam/sugar-build/build/out/install/lib/python2.7/site-packages/sugar3/graphics/palettewindow.py", line 640, in update_position
position = invoker.get_position(req)
File "/home/saam/sugar-build/build/out/install/lib/python2.7/site-packages/sugar3/graphics/palettewindow.py", line 915, in get_position
alignment = self.get_alignment(palette_dim)
File "/home/saam/sugar-build/build/out/install/lib/python2.7/site-packages/sugar3/graphics/palettewindow.py", line 943, in get_alignment
ph = best_alignment[0]
TypeError: 'NoneType' object has no attribute '__getitem__'
But why even is the palette being shown when you release the drag? That shouldn't happen. Maybe that is the real bug?
Reviewed.
The log is always filled with many of these errors where division by zero takes place especially when I drag objects from the clipboard to other places.
This is happening since the palette_dim.width is becoming 0 at times, so its rising the division by zero error.