95 and its subsequent fix 3cc932995c89e291e91cb917a52f10f6ccf89820 rectified a problem of line numbers in RepyV2 tracebacks being off by two. Part of the implementation changed safe_check.py to adjust the line numbers in Exception objects accordingly.
It can happen that an Exception object lacks a lineno attribute, and the code takes care of this. However, I recently saw an Exception with e.lineno == None, and then we get this error:
Traceback (most recent call last):
File "/private/tmp/repy_v2/RUNNABLE/safe_check.py", line 33, in <module>
len(encoding_header.ENCODING_DECLARATION.splitlines())
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'
Specified repy program is unsafe!
Static-code analysis failed with error: Code failed safety check! Error: Fatal error while evaluating code safety!
The fix is to also check for (and pass) TypeErrors in safe_check.py.
95 and its subsequent fix 3cc932995c89e291e91cb917a52f10f6ccf89820 rectified a problem of line numbers in RepyV2 tracebacks being off by two. Part of the implementation changed
safe_check.py
to adjust the line numbers in Exception objects accordingly.It can happen that an Exception object lacks a
lineno
attribute, and the code takes care of this. However, I recently saw an Exception withe.lineno == None
, and then we get this error:The fix is to also check for (and
pass
)TypeError
s insafe_check.py
.