NameError does not report the file and line

Asked by Ronan Meneu

Hello,

I am using Sikuli 1.1.0 and i find that SyntaxError is correctly reporting file and line, whereas NameError is not.

For instance, if i import a file toto.py (with import toto), and toto.py contains a syntax error, i can have:

  [error] SyntaxError ( ("mismatched input '\\n' expecting LPAREN", ('D:\\project\\mytest.sikuli\\toto.py', 1, 10, 'def blabla\n'))

But for a NameError, i will only get:

  [error] NameError ( global name 'self' is not defined )

And no clue about the file that is guilty. I have a first error saying that import toto fails (and i have file and line of this import). But if this toto file itself imports other files, i have to look into each of them to find where my issue is.

It is really not convenient for the debugging. Is it a know issue? Is there plan to fix it?

Thanks,

  Ronan

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Ronan Meneu
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

ok, a problem with 1.1.0

you might try the nightly 1.1.1 (http://sikulix.com)

Revision history for this message
Ronan Meneu (ronan-meneu) said :
#2

Indeed, much better with 1.1.1:

[error] NameError ( global name 'self' is not defined )
[error] --- Traceback --- error source first
line: module ( function ) statement
2: __init__ ( hhh ) self
5: __init__ ( <module> ) hhh()
[error] --- Traceback --- end --------------

C:\sikuli1.1.1>

Issue was also visible for other kind of errors (TypeError, etc.), and it's solved as well.
Thanks for the solution and the rapid answer!