pychecker --version 0.8.19
I tried to check ipython project with pychecker. It gives me " INTERNAL ERROR -- STOPPED PROCESSING FUNCTION --"
Some investigation shows that:
'str' type doesn't have 'format' method in pycheker internals. It was the problem which triggers error. I saw a list of builtin methods with ipython:
from pychecker import python
python.BUILTIN_METHODS.get(str)
See missing_format.py. Example output:
Processing module missing_format (missing_format.py)... missing_format.py:3: INTERNAL ERROR -- STOPPED PROCESSING FUNCTION -- Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/pychecker/warn.py", line 242, in _checkFunction _checkCode(code, codeSource) File "/usr/lib/python2.7/dist-packages/pychecker/warn.py", line 153, in _checkCode dispatch_func(oparg, operand, codeSource, code) File "/usr/lib/python2.7/dist-packages/pychecker/CodeChecks.py", line 1690, in _CALL_FUNCTION _handleFunctionCall(codeSource, code, oparg) File "/usr/lib/python2.7/dist-packages/pychecker/CodeChecks.py", line 474, in _handleFunctionCall check_arg_count) File "/usr/lib/python2.7/dist-packages/pychecker/CodeChecks.py", line 250, in _checkBuiltin _validateKwArgs(code, methodInfo, func_name[1], kwArgs) File "/usr/lib/python2.7/dist-packages/pychecker/CodeChecks.py", line 192, in _validateKwArgs if len(info) < 4: TypeError: object of type 'NoneType' has no len()
pychecker can't deduce type of string without a variable (string literal): the same problem don't appear if I use the same example with "string_contents" instead of variable 'src = "string_contents"'. I found a code in CodeChecks.py which determine a type of a variable, it looks like this:
objType = code.typeMap.get(utils.safestr(func_name[0]), [])
Pychecker probably need to distinguish variable from literals to handle such cases. Example for the second problem is in str_handling.py.
Example for the second problem