Repository: kivy/kivy

Issue:
Crash in multistroke demo on Python 3
When starting to draw a gesture in the multistroke demo, the following traceback occurs. Happened on Ubuntu 15.10 using Python 3.4.3+, both with the stable Kivy 1.9.0 and with the dev version on https://github.com/kivy/kivy/commit/9d07f45f310bf703088dd6e9c3aa832bacae0085.

[INFO   ] [Logger      ] Record log in /home/wyverex/.kivy/logs/kivy_16-01-26_5.txt
[INFO   ] [Kivy        ] v1.9.2-dev0
[INFO   ] [Python      ] v3.4.3+ (default, Oct 14 2015, 16:03:50) 
[GCC 5.2.1 20151010]
[INFO   ] [Factory     ] 179 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_gif, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [OSC         ] using <multiprocessing> for socket
[INFO   ] [Window      ] Provider: sdl2(['window_egl_rpi'] ignored)
[INFO   ] [GL          ] OpenGL version <b'3.0 Mesa 11.0.2'>
[INFO   ] [GL          ] OpenGL vendor <b'nouveau'>
[INFO   ] [GL          ] OpenGL renderer <b'Gallium 0.4 on NVC8'>
[INFO   ] [GL          ] OpenGL parsed version: 3, 0
[INFO   ] [GL          ] Shading version <b'1.30'>
[INFO   ] [GL          ] Texture max size <16384>
[INFO   ] [GL          ] Texture max units <16>
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [Clipboard   ] Provider: xsel(['clipboard_dbusklipper', 'clipboard_gtk3', 'clipboard_xclip'] ignored)
[INFO   ] [CutBuffer   ] cut buffer support enabled
[INFO   ] [Base        ] Start application main loop
[INFO   ] [GL          ] NPOT texture support is available
[INFO   ] [Base        ] Leaving application in progress...
 Traceback (most recent call last):
   File "main.py", line 144, in <module>
     MultistrokeApp().run()
   File "/home/wyverex/.virtualenvs/kivy/lib/python3.4/site-packages/kivy/app.py", line 828, in run
     runTouchApp()
   File "/home/wyverex/.virtualenvs/kivy/lib/python3.4/site-packages/kivy/base.py", line 487, in runTouchApp
     EventLoop.window.mainloop()
   File "/home/wyverex/.virtualenvs/kivy/lib/python3.4/site-packages/kivy/core/window/window_sdl2.py", line 622, in mainloop
     self._mainloop()
   File "/home/wyverex/.virtualenvs/kivy/lib/python3.4/site-packages/kivy/core/window/window_sdl2.py", line 365, in _mainloop
     EventLoop.idle()
   File "/home/wyverex/.virtualenvs/kivy/lib/python3.4/site-packages/kivy/base.py", line 330, in idle
     self.dispatch_input()
   File "/home/wyverex/.virtualenvs/kivy/lib/python3.4/site-packages/kivy/base.py", line 315, in dispatch_input
     post_dispatch_input(*pop(0))
   File "/home/wyverex/.virtualenvs/kivy/lib/python3.4/site-packages/kivy/base.py", line 221, in post_dispatch_input
     listener.dispatch('on_motion', etype, me)
   File "kivy/_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (/tmp/pip-zifa0zlv-build/kivy/_event.c:7312)
   File "/home/wyverex/.virtualenvs/kivy/lib/python3.4/site-packages/kivy/core/window/__init__.py", line 1034, in on_motion
     self.dispatch('on_touch_down', me)
   File "kivy/_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (/tmp/pip-zifa0zlv-build/kivy/_event.c:7312)
   File "/home/wyverex/.virtualenvs/kivy/lib/python3.4/site-packages/kivy/core/window/__init__.py", line 1050, in on_touch_down
     if w.dispatch('on_touch_down', touch):
   File "kivy/_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (/tmp/pip-zifa0zlv-build/kivy/_event.c:7312)
   File "/home/wyverex/.virtualenvs/kivy/lib/python3.4/site-packages/kivy/uix/widget.py", line 432, in on_touch_down
     if child.dispatch('on_touch_down', touch):
   File "kivy/_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (/tmp/pip-zifa0zlv-build/kivy/_event.c:7312)
   File "/home/wyverex/.virtualenvs/kivy/lib/python3.4/site-packages/kivy/uix/screenmanager.py", line 1070, in on_touch_down
     return super(ScreenManager, self).on_touch_down(touch)
   File "/home/wyverex/.virtualenvs/kivy/lib/python3.4/site-packages/kivy/uix/widget.py", line 432, in on_touch_down
     if child.dispatch('on_touch_down', touch):
   File "kivy/_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (/tmp/pip-zifa0zlv-build/kivy/_event.c:7312)
   File "/home/wyverex/.virtualenvs/kivy/lib/python3.4/site-packages/kivy/uix/relativelayout.py", line 278, in on_touch_down
     ret = super(RelativeLayout, self).on_touch_down(touch)
   File "/home/wyverex/.virtualenvs/kivy/lib/python3.4/site-packages/kivy/uix/widget.py", line 432, in on_touch_down
     if child.dispatch('on_touch_down', touch):
   File "kivy/_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (/tmp/pip-zifa0zlv-build/kivy/_event.c:7312)
   File "/home/wyverex/.virtualenvs/kivy/lib/python3.4/site-packages/kivy/uix/gesturesurface.py", line 346, in on_touch_down
     g = self.init_gesture(touch)
   File "/home/wyverex/.virtualenvs/kivy/lib/python3.4/site-packages/kivy/uix/gesturesurface.py", line 418, in init_gesture
     line_width=self.line_width, color=col)
   File "/home/wyverex/.virtualenvs/kivy/lib/python3.4/site-packages/kivy/uix/gesturesurface.py", line 104, in __init__
     super(GestureContainer, self).**init**(**kwargs)
   File "kivy/_event.pyx", line 254, in kivy._event.EventDispatcher.__init__ (/tmp/pip-zifa0zlv-build/kivy/_event.c:4679)
 TypeError: object.__init__() takes no parameters



Discussion:

Resolving patch:
diff --git a/kivy/uix/gesturesurface.py b/kivy/uix/gesturesurface.py
--- a/kivy/uix/gesturesurface.py
+++ b/kivy/uix/gesturesurface.py
@@ -414,8 +414,7 @@ def init_gesture(self, touch):
         if self.use_random_color is True:
             col = hsv_to_rgb(random(), 1., 1.)
 
-        g = GestureContainer(touch, max_strokes=self.max_strokes,
-                             line_width=self.line_width, color=col)
+        g = GestureContainer(touch, max_strokes=self.max_strokes, color=col)
 
         # Create the bounding box Rectangle for the gesture
         if self.draw_bbox:


Test patch: