Parsing Error: "Ren'Py Can't Understand Tabs"

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
ArcialIntegra
Regular
Posts: 53
Joined: Mon Nov 13, 2017 12:10 am
Contact:

Parsing Error: "Ren'Py Can't Understand Tabs"

#1 Post by ArcialIntegra »

So, here's the thing... I've used tab before, and it's ALWAYS been interpreted by Ren'Py as 4 spaces. Now, however, it isn't interpreting it and saying that there is an issue with my script. The problem is: even when I delete those tabs, turn them into actual spaces, Ren'Py is now interpreting those 4 spaces as a Tab. I'm not sure what is going on. I can't paste the script because it's not entirely my script to paste, but it basically boils down to the indentation in relation to a menu, at least that's where the errors are coming so far for me.
I'll keep working on it myself and try to figure out what's going on, but if somebody can explain what's going wrong before I figure it out myself, I'd appreciate it!

User avatar
vollschauer
Veteran
Posts: 231
Joined: Sun Oct 11, 2015 9:38 am
Github: vollschauer
Contact:

Re: Parsing Error: "Ren'Py Can't Understand Tabs"

#2 Post by vollschauer »

I don't think RenPy ever worked with tabs, make sure you work with an editor where you see the difference between tabs and spaces. But you post at least your error message here....

ArcialIntegra
Regular
Posts: 53
Joined: Mon Nov 13, 2017 12:10 am
Contact:

Re: Parsing Error: "Ren'Py Can't Understand Tabs"

#3 Post by ArcialIntegra »

Generally I would post the error message, but it was just the standard

Code: Select all

Parsing Error:
An uncaught exception occurred:
While parsing, scriptfileinquestion.rpy contains a tab character on line ###. Tab characters are not allowed in Ren'Py scripts.
Or something to that effect.

There's really no details given. I use Editra and I THINK Editra automatically turns tabs into 4 spaces, because I've never had an issue with pressing Tab and my script running before this point, as I already stated quite clearly in my initial post. (Not trying to sound passive-aggressive, just pointing out I already addressed this point of yours.)
The problem is that I'm having trouble with the same lines even AFTER I delete the Tabs and replace them with spaces manually. Renpy, in some situations, is even mistaking 4 spaces as a Tab. It's POSSIBLE this is an Editra error, but that's why I thought I'd ask. Surely somebody else uses the default text editing program Renpy came with and has had this issue and knows if it is an Editra-side or Ren'Py-side error, what to do about it, and [what is causing]/[how to prevent] the issue in the first place. (I didn't originally mention Editra, because I didn't initially consider the idea that it was Editra converting Tabs into spaces. I was assuming Ren'Py just understood the indentation. That said, it should still be clear that it's a software-side not user-side cause.)

It's worth noting I've been spending the past half hour fixing and RE-fixing the same lines repeatedly. Some stay "fixed". Others keep returning the error. There seems to be no rhyme or reason to it. It also randomly started at line 350-something, meaning there were that many lines with actual "Tab" pressed that were NOT returning the error. Also, Ren'Py is only returning the error on one line at a time. So, I don't have a list of lines with the error, just get told one-by-one which are errored.

User avatar
vollschauer
Veteran
Posts: 231
Joined: Sun Oct 11, 2015 9:38 am
Github: vollschauer
Contact:

Re: Parsing Error: "Ren'Py Can't Understand Tabs"

#4 Post by vollschauer »

Just because you pressed TAB doesn't mean you get a tab character in your editor, I setup in my editor (Geany) for example that if I press TAB that I get 4 spaces. Just search your whole project files for a tab character and replace it with 4 spaces...that's it.

Haveing an editor where you can see spaces vs. tabs might help you ....
Screenshot from 2017-11-22 11-28-26.png
Screenshot from 2017-11-22 11-28-26.png (4.32 KiB) Viewed 1099 times

Errilhl
Regular
Posts: 164
Joined: Wed Nov 08, 2017 4:32 pm
Projects: HSS
Deviantart: studioerrilhl
Github: studioerrilhl
Contact:

Re: Parsing Error: "Ren'Py Can't Understand Tabs"

#5 Post by Errilhl »

Yeah, I would search the source-file for tab-characters as well - it might not be in front of the content, btw, someone might have pressed the tab-key after whatever text or code there is, and that might not be interpreted as spaces. Or, someone has copy-pasted code into the file from somewhere else, and that has kept the tabs that were there already. Plenty of ways these things can happen.
Currently working on: Image

Post Reply

Who is online

Users browsing this forum: Google [Bot]