Kivy (Python) TypeError: expected string or buffer : <p>I am new to Kivy and I am trying to make an App that count words in a string and display the number of words on a new popup , And I keep getting this error message even with using str() . Type-error: expected string or buffer
Here is the code :</p>

<pre><code>from kivy.app import App
from kivy.uix.popup import Popup
from kivy.uix.label import Label
from kivy.uix.boxlayout import BoxLayout
import re


class CountRoot(BoxLayout):
    def clk(self, text_input):

        text = Label(text="Hello, {}!".format(text_input))
        res = re.findall("(\S+)", text)
        nw = Popup(title="Our Title!", content=res,size_hint=(.7, .7))
        nw.open()


class CountApp(App):
    def build(self):
        return CountRoot()


if __name__ == "__main__":
     CountApp().run()
</code></pre>

<p>Here is the kivy file : </p>

<pre><code>&lt;CountRoot&gt;:
orientation: "vertical"
padding: root.width * .02, root.height * .02
spacing: "10dp"


TextInput:
    id: text_input
    hint_text: "Enter Text"
    font_size: "30dp"

Button:
    text: "Press Me"
    on_release: root.clk(text_input.text)
</code></pre>
