Repository: kivy/kivy

Issue:
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
 hi all, i have installed python3-kivy-git(archlinux),it looks well.

but when i run repo's examples/demo/pictures `python3 main.py` it's error. anyone have a hack tip.

```
[INFO   ] [Logger      ] Record log in /home/doom/.kivy/logs/kivy_15-05-18_8.txt
[INFO   ] [Kivy        ] v1.9.1-dev
[INFO   ] [Python      ] v3.4.3 (default, Mar 25 2015, 17:13:50) 
[GCC 4.9.2 20150304 (prerelease)]
[INFO   ] [Factory     ] 175 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_gif, img_pygame, img_pil (img_ffpyplayer ignored)
[INFO   ] [Window      ] Provider: pygame(['window_egl_rpi'] ignored)
[WARNING] [WinPygame   ] Video: failed (multisamples=2)
[WARNING] [WinPygame   ] trying without antialiasing
[INFO   ] [GL          ] OpenGL version <b'3.0 Mesa 10.5.5'>
[INFO   ] [GL          ] OpenGL vendor <b'VMware, Inc.'>
[INFO   ] [GL          ] OpenGL renderer <b'Gallium 0.4 on llvmpipe (LLVM 3.6, 128 bits)'>
[INFO   ] [GL          ] OpenGL parsed version: 3, 0
[INFO   ] [GL          ] Shading version <b'1.30'>
[INFO   ] [GL          ] Texture max size <8192>
[INFO   ] [GL          ] Texture max units <18>
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [GL          ] NPOT texture support is available
[INFO   ] [Text        ] Provider: pygame
[INFO   ] [OSC         ] using <multiprocessing> for socket
Traceback (most recent call last):
File "main.py", line 76, in <module>
    PicturesApp().run()
File "/usr/lib/python3.4/site-packages/kivy/app.py", line 824, in run
    runTouchApp()
File "/usr/lib/python3.4/site-packages/kivy/base.py", line 451, in runTouchApp
    p = provider(key, args)
File "/usr/lib/python3.4/site-packages/kivy/input/providers/probesysfs.py", line 154, in __new__
    instance.__init__(device, args)
File "/usr/lib/python3.4/site-packages/kivy/input/providers/probesysfs.py", line 191, in __init__
    self.probe()
File "/usr/lib/python3.4/site-packages/kivy/input/providers/probesysfs.py", line 201, in probe
    inputs = get_inputs(self.input_path)
File "/usr/lib/python3.4/site-packages/kivy/input/providers/probesysfs.py", line 138, in get_inputs
    _cache_input = [Input(x) for x in glob(event_glob)]
File "/usr/lib/python3.4/site-packages/kivy/input/providers/probesysfs.py", line 138, in <listcomp>
    _cache_input = [Input(x) for x in glob(event_glob)]
File "/usr/lib/python3.4/site-packages/kivy/input/providers/probesysfs.py", line 69, in __init__
    query_xinput()
File "/usr/lib/python3.4/site-packages/kivy/input/providers/probesysfs.py", line 123, in query_xinput
    if prop.startswith('Device Enabled') and prop.endswith('0'):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
```



Discussion:
I have a similar issue when trying to run with python3 (3.4.0) under Ubuntu 14.04.

```
okto:~/Devel/Stack$ python3 main.py
[INFO   ] [Logger      ] Record log in /home/okto/.kivy/logs/kivy_15-05-21_8.txt
[INFO   ] [Kivy        ] v1.9.1-dev
[INFO   ] [Python      ] v3.4.0 (default, Apr 11 2014, 13:05:11) 
[GCC 4.8.2]
[INFO   ] [Factory     ] 175 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_gif, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO   ] [OSC         ] using <multiprocessing> for socket
[INFO   ] [Window      ] Provider: sdl2(['window_egl_rpi'] ignored)
[INFO   ] [GL          ] OpenGL version <b'3.0 Mesa 10.1.3'>
[INFO   ] [GL          ] OpenGL vendor <b'Intel Open Source Technology Center'>
[INFO   ] [GL          ] OpenGL renderer <b'Mesa DRI Intel(R) Haswell Mobile '>
[INFO   ] [GL          ] OpenGL parsed version: 3, 0
[INFO   ] [GL          ] Shading version <b'1.30'>
[INFO   ] [GL          ] Texture max size <8192>
[INFO   ] [GL          ] Texture max units <32>
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [Text        ] Provider: sdl2
 Traceback (most recent call last):
   File "main.py", line 91, in <module>
     StackApp().run()
   File "/usr/lib/python3/dist-packages/kivy/app.py", line 824, in run
     runTouchApp()
   File "/usr/lib/python3/dist-packages/kivy/base.py", line 451, in runTouchApp
     p = provider(key, args)
   File "/usr/lib/python3/dist-packages/kivy/input/providers/probesysfs.py", line 154, in __new__
     instance.__init__(device, args)
   File "/usr/lib/python3/dist-packages/kivy/input/providers/probesysfs.py", line 191, in __init__
     self.probe()
   File "/usr/lib/python3/dist-packages/kivy/input/providers/probesysfs.py", line 201, in probe
     inputs = get_inputs(self.input_path)
   File "/usr/lib/python3/dist-packages/kivy/input/providers/probesysfs.py", line 138, in get_inputs
     _cache_input = [Input(x) for x in glob(event_glob)]
   File "/usr/lib/python3/dist-packages/kivy/input/providers/probesysfs.py", line 138, in <listcomp>
     _cache_input = [Input(x) for x in glob(event_glob)]
   File "/usr/lib/python3/dist-packages/kivy/input/providers/probesysfs.py", line 69, in __init__
     query_xinput()
   File "/usr/lib/python3/dist-packages/kivy/input/providers/probesysfs.py", line 123, in query_xinput
     if prop.startswith('Device Enabled') and prop.endswith('0'):
 TypeError: startswith first arg must be bytes or a tuple of bytes, not str
```

Running with python (2.7.6) works fine and running with python3 was working until relatively recently.

@NSMarkop now , i have install into virtualbox lununtu py2.7 . also work fine 

This issue affects me. Python 3.4.0 and Kivy 1.9.1-dev

I have the same problem. Python 3.4 and python3-kivy-git(arch).


Resolving patch:
diff --git a/kivy/input/providers/probesysfs.py b/kivy/input/providers/probesysfs.py
--- a/kivy/input/providers/probesysfs.py
+++ b/kivy/input/providers/probesysfs.py
@@ -120,10 +120,10 @@ def query_xinput():
                 evpath = None
                 for prop in devprops.splitlines():
                     prop = prop.strip()
-                    if prop.startswith('Device Enabled') and prop.endswith('0'):
+                    if prop.startswith(b'Device Enabled') and prop.endswith(b'0'):
                         evpath = None
                         break
-                    if prop.startswith('Device Node'):
+                    if prop.startswith(b'Device Node'):
                         try:
                             evpath = prop.split('"')[1]
                         except Exception:


Test patch: