Page 1 of 1

Object of type 'NoneType' has no len()

Posted: Fri Jun 01, 2018 6:10 pm
by Nonohell
Hi !
I recently got this error when i delete my persistent and now when i click to the start button i got this error message:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
TypeError: object of type 'NoneType' has no len()

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in script
    python hide:
  File "C:\Users\boulanger\Downloads\renpy-\renpy\", line 848, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide,
  File "C:\Users\boulanger\Downloads\renpy-\renpy\", line 1812, in py_exec_bytecode
    exec bytecode in globals, locals
  File "renpy/common/_layout/screen_main_menu.rpym", line 35, in <module>
  File "C:\Users\boulanger\Downloads\renpy-\renpy\", line 287, in interact
    rv =, **kwargs)
  File "C:\Users\boulanger\Downloads\renpy-\renpy\display\", line 2624, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "C:\Users\boulanger\Downloads\renpy-\renpy\display\", line 3000, in interact_core
  File "C:\Users\boulanger\Downloads\renpy-\renpy\display\", line 1040, in input_post_per_interact
    i.update_text(content, editable)
  File "C:\Users\boulanger\Downloads\renpy-\renpy\display\", line 1177, in update_text
  File "C:\Users\boulanger\Downloads\renpy-\renpy\display\", line 1171, in set_content
    l = len(content)
TypeError: object of type 'NoneType' has no len()

Fri Jun 01 23:16:51 2018
I think the error come from this part of code cause when i delete it the game start normally:

Code: Select all

textbutton _("Nouvelle partie") action If(persistent.playername, true=Start(), false=Show(screen="name_input", message="Veuillez entrer votre nom", confirm_action=Function(FinishEnterName)))

init -501 screen name_input(message, confirm_action):

    modal True

    zorder 200

    style_prefix "confirm"

    add "gui/overlay/confirm.png"
    key "K_RETURN" action [Play("sound", gui.activate_sound), confirm_action]


        has vbox:
            xalign .5
            yalign .5
            spacing 30

        label _(message):
            style "confirm_prompt"
            xalign 0.5

        input default "" value VariableInputValue("player") length 15 allow "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"

            xalign 0.5
            spacing 100

            textbutton _("confirmer") action confirm_action
Thank you for help !!

Re: Object of type 'NoneType' has no len()

Posted: Fri Jun 01, 2018 6:46 pm
by Alex
Try to set default value for persistent.playername ... -statement

Re: Object of type 'NoneType' has no len()

Posted: Fri Jun 01, 2018 6:55 pm
by Taleweaver
Moved to Ren'Py Questions.

Re: Object of type 'NoneType' has no len()

Posted: Sat Jun 02, 2018 5:47 am
by Nonohell
Yeah that work ! Thank tou so much Alex !