Support Tip: [Fortify Static Code Analyzer] SCA 22.1 - java.lang.NullPointerException: null with Python 3

0 Likes

Summary
When translating Python 3 code with SCA 22.x, it fails with error: [error]: Unexpected exception while parsing file Issue1.py java.lang.NullPointerException: null at com.fortify.frontend.translator.python3.Python3Translator.visitCompound_stmt(Python3Translator.java:5513) ~[sca-frontend-22.1.0.0166.jar:?]

Products
Fortify Static Code Analyzer

Environment
Fortify SCA 22.1

Situation
[error]: Unexpected exception while parsing file Issue1.py java.lang.NullPointerException: null at com.fortify.frontend.translator.python3.Python3Translator.visitCompound_stmt(Python3Translator.java:5513) ~[sca-frontend-22.1.0.0166.jar:?]

Example for Python version translation: sourceanalyzer -b PythonTest2 *.py

Cause
By default SCA translates Python version 2.

Resolution
Use -python-version 3 in SCA translation phase.

Read Full Support Article here. 

Support Article Reference Number (URL Name)
KM000008208

Labels:

Knowledge Docs
Comment List
Related
Recommended