添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
机灵的小熊猫  ·  invalid number of ...·  8 月前    · 
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Unexpected exception while parsing file - (Python)

What does this error mean?

command:

sourceanalyzer -verbose -b ${buildID} -python-version 3 -python-path /usr/lib/python3.7:/usr/local/lib/python3.7/site-packages /dir/**/*.py

error log:

[error]: Unexpected exception while parsing file Notebook.py
java.lang.NullPointerException: null
	at com.fortify.frontend.translator.nodes.STExpressionList.addChild(STExpressionList.java:60) ~[sca-frontend-19.2.0.0196.jar:?]
	at com.fortify.frontend.translator.python3.Python3Translator.visitTestlist_star_expr(Python3Translator.java:3584) ~[sca-frontend-19.2.0.0196.jar:?]
	at com.fortify.frontend.translator.python3.Python3Translator.buildAssignment(Python3Translator.java:3207) ~[sca-frontend-19.2.0.0196.jar:?]
	at com.fortify.frontend.translator.python3.Python3Translator.visitExpr_stmt(Python3Translator.java:2986) ~[sca-frontend-19.2.0.0196.jar:?]
	at com.fortify.frontend.translator.python3.Python3Translator.visitSmall_stmt(Python3Translator.java:5274) ~[sca-frontend-19.2.0.0196.jar:?]
	at com.fortify.frontend.translator.python3.Python3Translator.visitSimple_stmt(Python3Translator.java:5222) ~[sca-frontend-19.2.0.0196.jar:?]
	at com.fortify.frontend.translator.python3.Python3Translator.visitStmt(Python3Translator.java:5210) ~[sca-frontend-19.2.0.0196.jar:?]
	at com.fortify.frontend.translator.python3.Python3Translator.visitStmt(Python3Translator.java:51) ~[sca-frontend-19.2.0.0196.jar:?]
	at com.fortify.frontend.parser.python3.Python3Parser$StmtContext.accept(Python3Parser.java:2099) ~[sca-frontend-19.2.0.0196.jar:?]
	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46) ~[antlr4-runtime-4.7.jar:4.7]
	at com.fortify.frontend.translator.python3.Python3Translator.visitFile_input(Python3Translator.java:2385) ~[sca-frontend-19.2.0.0196.jar:?]
	at com.fortify.frontend.translator.python3.Python3Translator.visitFile_input(Python3Translator.java:51) ~[sca-frontend-19.2.0.0196.jar:?]
	at com.fortify.frontend.parser.python3.Python3Parser$File_inputContext.accept(Python3Parser.java:491) ~[sca-frontend-19.2.0.0196.jar:?]
	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18) ~[antlr4-runtime-4.7.jar:4.7]
	at com.fortify.frontend.parser.python3.Python3ParserWrapper.translate(Python3ParserWrapper.java:65) ~[sca-frontend-19.2.0.0196.jar:?]
	at com.fortify.frontend.parser.python3.Python3ParserWrapper.parse(Python3ParserWrapper.java:101) ~[sca-frontend-19.2.0.0196.jar:?]
	at com.fortify.sca.frontend.Python3FrontEnd.runParseTranslateResolvePython(Python3FrontEnd.java:280) [fortify-sca-19.2.0.0196.jar:?]
	at com.fortify.sca.frontend.Python3FrontEnd.runTranslator(Python3FrontEnd.java:209) [fortify-sca-19.2.0.0196.jar:?]
	at com.fortify.sca.frontend.FrontEndSession.runSingleFrontEnd(FrontEndSession.java:229) [fortify-sca-19.2.0.0196.jar:?]
	at com.fortify.sca.frontend.FrontEndSession.runFrontEnd(FrontEndSession.java:188) [fortify-sca-19.2.0.0196.jar:?]
	at com.fortify.sca.Main$Sourceanalyzer.run(Main.java:533) [fortify-sca-19.2.0.0196.jar:?]

I'm ussing SCA v19.2

I have a similar issue in matplotlib/scale.py using version 21.2.3

D:\Apps\fortify\Fortify_SCA_and_Apps_21.2.3\bin>sourceanalyzer -b nexus -python-version 3 -python-path d:\apps\python38_64;d:\apps\python38_64;d:\Apps\python38_64\Lib\site-packages;d:\nexus\dev20\python\package d:\nexus\dev20\python\**\*.py
[error]: Unexpected exception while parsing file d:/Apps/python38_64/Lib/site-packages/matplotlib/scale.py
java.lang.StringIndexOutOfBoundsException: begin 0, end -1, length 1
at java.lang.String.checkBoundsBeginEnd(String.java:3319) ~[?:?]
at java.lang.String.substring(String.java:1874) ~[?:?]

The opinions expressed above are the personal opinions of the authors, not of OpenText. By using this site, you accept the Terms of Use. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.), Hewlett Packard Enterprise Company, or Micro Focus. As of January 31, 2023, the Material is now offered by OpenText, a separately owned and operated company. Any reference to the HP, Hewlett Packard Enterprise/HPE, and Micro Focus marks is historical in nature and the HP, Hewlett Packard Enterprise/HPE, and Micro Focus marks are the property of their respective owners.