Error messages not giving line numbers

Official forum for open source FreePIE discussion and development.
Post Reply
Jellybit
One Eyed Hopeful
Posts: 2
Joined: Tue Dec 03, 2013 10:51 am

Error messages not giving line numbers

Post by Jellybit »

I'm loving FreePIE and have used it to go keyboardless with my art programs. However, my script has suddenly stopped working. I'm no stranger to debugging, but FreePIE seems to have stopped giving line numbers on errors at some version (it's never given me line numbers for as long as I've used it). Check it out:

Image

I'm running 1.9.629.0 on Windows 10. Is anyone else experiencing this? I had this before where I was using tabs instead of spaces, but I replaced my tabs with spaces and it worked fine for a week. I've been doing some adjustments here and there to the script over time. I got this error again, and figured it was the same thing, but I don't have a single tab in the document (did a search in Notepad++), and all my indents appear to be correct. This is maddening because if I had a simple line number, this could be fixed in seconds. Instead, I've wasted tons of time combing through every single space in the entire script looking for the problem.

Is there something I'm missing? Am I alone? Thanks!
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Error messages not giving line numbers

Post by CyberVillain »

hmm, seems that script errors are handled different from runtime errors.
So i do not think you hav ever gotten line numbers for script errors. Anyway, found a workaround

Try this version, let me know if it works. Make sure to unblock the dll
You do not have the required permissions to view the files attached to this post.
Jellybit
One Eyed Hopeful
Posts: 2
Joined: Tue Dec 03, 2013 10:51 am

Re: Error messages not giving line numbers

Post by Jellybit »

Thanks! This is beautiful. That helped narrow it down. It seems that FreePIE is somehow confused by commented out code. For instance:

Code: Select all

"""
    if wiimote[0].buttons.button_down(WiimoteButtons.A) and wiimote[0].buttons.button_down(WiimoteButtons.B):
        button_LeftControl += 1
    elif wiimote[0].buttons.button_down(WiimoteButtons.A):
        button_LeftAlt += 1
    elif wiimote[0].buttons.button_down(WiimoteButtons.B):
        button_LeftShift += 1
"""
This uses the python standard of commenting out everything between the triple quotation marks. It should all be ignored, but it seems that it didn't like the indented if statement following it. If I remove all of the comment, it's perfectly fine with the indented if statement that comes after. Strange!

Anyway, it works now. I was hoping to be able to comment code like this, but apparently I have to comment out code line by line.

Thank you again!
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Error messages not giving line numbers

Post by CyberVillain »

Its our python lib that spits out that error, its compliant with Python 2.7 so I guess you would get this behavior when running same code on native 2.7 python engine.
Terran
One Eyed Hopeful
Posts: 10
Joined: Tue Mar 22, 2016 4:51 pm

Re: Error messages not giving line numbers

Post by Terran »

You could test your entire code (including the commeted out section) using Python lint: http://infoheap.com/python-lint-online/
That also helped me in the "no line number" situation I ran into as well ;)
Post Reply

Return to “FreePIE”