- AuthorPosts
- October 18, 2007 at 2:52 am #4803VladMember
This macro:
#language="Python"
Window.alert('ok')
results in error after successful alert display:
Traceback (most recent call last):
File "<Script Block >", line 2, in <module>
d
NameError: name 'd' is not definedThe macro file has Windows line endings and ends with a single newline (rn).
There is no error if the macro ends with two newlines.
If the macro has three newlines at the end, the error is:Traceback (most recent call last):
File "<Script Block >", line 4, in <module>
c
NameError: name 'c' is not definedConvert the last macro to Unix line endings. It ends with 3 newlines (n). Error:
Traceback (most recent call last):
File "<Script Block >", line 4, in <module>
d
NameError: name 'd' is not definedOctober 18, 2007 at 5:19 pm #4811Yutaka EmuraKeymasterVlad wrote:
This macro:#language="Python"
Window.alert('ok')
results in error after successful alert display:
Traceback (most recent call last):
File "<Script Block >", line 2, in <module>
d
NameError: name 'd' is not definedThe macro file has Windows line endings and ends with a single newline (rn).
There is no error if the macro ends with two newlines.
If the macro has three newlines at the end, the error is:Traceback (most recent call last):
File "<Script Block >", line 4, in <module>
c
NameError: name 'c' is not definedConvert the last macro to Unix line endings. It ends with 3 newlines (n). Error:
Traceback (most recent call last):
File "<Script Block >", line 4, in <module>
d
NameError: name 'd' is not definedIs this a new bug only in version 7, or existed from version 6?
October 18, 2007 at 6:50 pm #4812VladMemberThis is a new bug only in version 7.
My actual script, which was ok with version 6, looks like this:#language="Python"
if 0:
pass
else:
Window.alert('ok')
It has windows line endings and ends with 3 newlines
Now this gives error message:
invalid syntax
Line 8Line 8 is the end of file. Remove the last line and it runs fine. Other variations of the number of trailing line endings and indents give errors similar to the first post. This is quite mysterious.
October 19, 2007 at 4:49 pm #4819Yutaka EmuraKeymasterVlad wrote:
This is a new bug only in version 7.
My actual script, which was ok with version 6, looks like this:#language="Python"
if 0:
pass
else:
Window.alert('ok')
It has windows line endings and ends with 3 newlines
Now this gives error message:
invalid syntax
Line 8Line 8 is the end of file. Remove the last line and it runs fine. Other variations of the number of trailing line endings and indents give errors similar to the first post. This is quite mysterious.
I reproduced this bug, and it will be fixed on beta 20. There was a bug where dealing with the end of file in macros. Thanks!
- AuthorPosts
- You must be logged in to reply to this topic.