Page MenuHome

blender 2.8 malfunctions when reporting an indentation error executing a python script
Open, Needs Information from UserPublic

Description

System Information
Operating system: Linux
Graphics card: NVIDIA Corporation GP106M [GeForce GTX 1060 Mobile]

Blender Version
Broken: version: 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash: f6cb5f54494e, type: Release
Worked: 2.79

when using the [Run Script] button in the text panel if the script has an indentation error the message sent to stdout (or stderr?) just says

AttributeError: 'IndentationError' object has no attribute 'msg'
Error: Python script failed, check the message in the system console

while older versions (like 2.79) would give a much more detailed message like

Error:   File "/triangle_anim_2.py", line 129
    def make_dot(loc, base, arm, i, mat):
      ^
IndentationError: expected an indented block

and highlight some text near the error in the text buffer

Exact steps for others to reproduce the error

try to run the following python script inside the editor:

def bacon():
    
def eggs():
    pass

Details

Type
Bug

Event Timeline

I can't redo this error, in 2.80, I get the same behavior as 2.7x

Could you try run this:

print(IndentationError().msg)

Campbell Barton (campbellbarton) triaged this task as Needs Information from User priority.Mon, Aug 19, 9:56 PM

Quite strangely everything works correctly when trying that line of code, but if I restart Blender and do the following I get the non descriptive indentation error:

Quite strangely everything works correctly when trying that line of code, but if I restart Blender and do the following I get the non descriptive indentation error:

yeah, thats where i ran into the error also, i had a subindented block with a 3 space indent instead of 4, and it was impossible to find - had to import the file into pycharm.