"TypeError" when reloading [Solved]

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
ketskari
Veteran
Posts: 271
Joined: Tue Dec 21, 2010 6:22 pm
Completed: Asher, Sunrise, Tell a Demon
Projects: Asher Remake, TEoA
Organization: Sun Labyrinth
Tumblr: sunlabyrinth
Deviantart: sunlabyrinth
Contact:

"TypeError" when reloading [Solved]

#1 Post by ketskari » Thu Apr 24, 2014 8:59 pm

Started a new game in 6.17.3, but when I try opening it in the latest version, I get this every time I reload the screen:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 80, in script
TypeError: expected string or buffer

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

Full traceback:
  File "\renpy-6.17.4-sdk\renpy\execution.py", line 294, in run
    node.execute()
  File "\renpy-6.17.4-sdk\renpy\ast.py", line 464, in execute
    renpy.exports.say(who, what, interact=self.interact)
  File "\renpy-6.17.4-sdk\renpy\exports.py", line 925, in say
    who(what, interact=interact)
  File "\renpy-6.17.4-sdk\renpy\character.py", line 795, in __call__
    who = who_pattern.replace("[who]", sub(who))
  File "\renpy-6.17.4-sdk\renpy\substitutions.py", line 210, in substitute
    s = renpy.translation.translate_string(s)
  File "\renpy-6.17.4-sdk\renpy\translation.py", line 366, in translate_string
    return stl.translate(s)
  File "\renpy-6.17.4-sdk\renpy\translation.py", line 321, in translate
    notags = re.sub(r"\{\#.*?\}", "", old)
  File "/home/tom/ab/x64lucid-deps/install/lib/python2.7/re.py", line 151, in sub
TypeError: expected string or buffer

Windows-7-6.1.7601-SP1
Ren'Py 6.17.4.409
TAD 0.0
I can play through just fine if I don't reload. But I can't figure out what's going wrong, since it seems to have issues with nearly all the lines? (Not just line 80, but every dialogue line following the start label).

Thanks in advance.
Last edited by ketskari on Sun Apr 27, 2014 11:22 pm, edited 1 time in total.

User avatar
PyTom
Ren'Py Creator
Posts: 15200
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: "TypeError" when reloading

#2 Post by PyTom » Thu Apr 24, 2014 11:12 pm

I don't know, offhand.

Could you send me the game, so I can try to repeat this?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
Lora
Regular
Posts: 25
Joined: Sat Jan 04, 2014 4:55 am
Projects: High Fog
Location: Texas
Contact:

Re: "TypeError" when reloading

#3 Post by Lora » Sun Apr 27, 2014 5:54 pm

From the sounds of things, I'm having the exact same issue. I just started using the latest release of ren'py - prior to this, I was using 6.13.8 and everything worked smoothly. Now I get TypeErrors upon fixing things in script and reloading the game. It usually plays for a little bit, but then it seems to hit a snag at a random point. It looks about the same but here's my error code if it for some reason helps:
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 518, in script
TypeError: expected string or buffer

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

Full traceback:
File "C:\Users\Lora\Downloads\renpy-6.17.4-sdk\renpy\execution.py", line 294, in run
node.execute()
File "C:\Users\Lora\Downloads\renpy-6.17.4-sdk\renpy\ast.py", line 464, in execute
renpy.exports.say(who, what, interact=self.interact)
File "C:\Users\Lora\Downloads\renpy-6.17.4-sdk\renpy\exports.py", line 925, in say
who(what, interact=interact)
File "C:\Users\Lora\Downloads\renpy-6.17.4-sdk\renpy\character.py", line 795, in __call__
who = who_pattern.replace("[who]", sub(who))
File "C:\Users\Lora\Downloads\renpy-6.17.4-sdk\renpy\substitutions.py", line 210, in substitute
s = renpy.translation.translate_string(s)
File "C:\Users\Lora\Downloads\renpy-6.17.4-sdk\renpy\translation.py", line 366, in translate_string
return stl.translate(s)
File "C:\Users\Lora\Downloads\renpy-6.17.4-sdk\renpy\translation.py", line 321, in translate
notags = re.sub(r"\{\#.*?\}", "", old)
File "/home/tom/ab/x64lucid-deps/install/lib/python2.7/re.py", line 151, in sub
TypeError: expected string or buffer

Windows-post2008Server-6.2.9200
Ren'Py 6.17.4.409
HF 0.0
Can also supply a copy of my game too if it helps. :)
Thanks!

User avatar
PyTom
Ren'Py Creator
Posts: 15200
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: "TypeError" when reloading

#4 Post by PyTom » Sun Apr 27, 2014 10:52 pm

Fixed here:

https://github.com/renpy/renpy/commit/9 ... b8462dfb90

To get the fix, download:

https://raw.githubusercontent.com/renpy ... _init__.py

And drop it in over renpy/__init__.py.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
ketskari
Veteran
Posts: 271
Joined: Tue Dec 21, 2010 6:22 pm
Completed: Asher, Sunrise, Tell a Demon
Projects: Asher Remake, TEoA
Organization: Sun Labyrinth
Tumblr: sunlabyrinth
Deviantart: sunlabyrinth
Contact:

Re: "TypeError" when reloading [Solved]

#5 Post by ketskari » Sun Apr 27, 2014 11:26 pm

Thanks!!
Image

User avatar
Lora
Regular
Posts: 25
Joined: Sat Jan 04, 2014 4:55 am
Projects: High Fog
Location: Texas
Contact:

Re: "TypeError" when reloading [Solved]

#6 Post by Lora » Wed Apr 30, 2014 6:09 am

Thank you! It's working fine for me now!

Sir Katherine
Newbie
Posts: 13
Joined: Sun Apr 27, 2014 10:07 pm
Contact:

Re: "TypeError" when reloading

#7 Post by Sir Katherine » Thu May 08, 2014 3:09 pm

PyTom wrote:Fixed here:

https://github.com/renpy/renpy/commit/9 ... b8462dfb90

To get the fix, download:

https://raw.githubusercontent.com/renpy ... _init__.py

And drop it in over renpy/__init__.py.
Sorry, quick question (I'm terrible with technological stuff): How do you do that? What does it mean to download it if there's no "download" button? And how do you drop it over something? :? Sorry. I'm totally new to this kind of thing.

User avatar
PyTom
Ren'Py Creator
Posts: 15200
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: "TypeError" when reloading [Solved]

#8 Post by PyTom » Fri May 09, 2014 9:48 pm

You just do a save as to download it.

Drop it in means to move the file you downloaded over an existing file.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Sir Katherine
Newbie
Posts: 13
Joined: Sun Apr 27, 2014 10:07 pm
Contact:

Re: "TypeError" when reloading [Solved]

#9 Post by Sir Katherine » Fri May 09, 2014 10:02 pm

PyTom wrote:You just do a save as to download it.

Drop it in means to move the file you downloaded over an existing file.
Thank you so much! It's working!

User avatar
PyTom
Ren'Py Creator
Posts: 15200
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: "TypeError" when reloading [Solved]

#10 Post by PyTom » Fri May 09, 2014 10:20 pm

Oh, you should probably just update to the new Ren'Py. It has the patch included.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: No registered users