python - Unexpected Indent Error at End of File -


for reason @ end of of python file in idle i'm getting indentation error, though block of code has right amount of spacing. when try run , told error, highlights whole line after code, instead of highlighting character before line of wrongly indented code, does.

here's screenshot demonstrating highlights: syntax error highlighting unusual place

for reference, how looks when highlighting real indent problem: syntax error highlighting normal place

the code has problems form:

if yes.lower() == 'y': linkfiles(folders) raw_input(iprint('= script finished, press enter quit.',true)) 

and form:

if yes.lower() == 'y':     linkfiles(folders) raw_input(iprint('= script finished, press enter quit.',true)) 

also yes, have confirmed i'm not mixing tabs , spaces. using spaces on these lines.

i checked whitespace @ end of file, error occurs same when there's no characters whatsoever after closing bracket. , attempting run script add newline character, nothing else.

as per suggestion, did try run through commandline , got same result:

c:\windows\system32>python "c:\users\ntreanor\desktop\user friendly scripts\create file links.py"   file "c:\users\ntreanor\desktop\user friendly scripts\create file links.py", line 135                                                                               ^ indentationerror: unexpected unindent 

this way more simple had thought.

i writing try: except: block on whole script, because i'm writing log , want spit out exceptions log can troubleshoot after fact when people have used script. details of question here

the problem got interrupted when writing script , forgot had added try not except. actual error was missing whole except block. once added

except: pass 

at end, ran fine.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -