4.10.1 python atndeserializer损坏了吗?
Java实现继续运行良好,但是Python实现在升级到4.10.1之前也一直在运行良好,现在在调整Atndeserialializer的第89行上抛出TypeError。
这是已知的错误吗?
Traceback (most recent call last):
File "/Users/vickery/Projects/dgw_processor/dgw_parser.py", line 15, in <module>
from ReqBlockLexer import ReqBlockLexer
File "/Users/vickery/Projects/dgw_processor/ReqBlockLexer.py", line 421, in <module>
class ReqBlockLexer(Lexer):
File "/Users/vickery/Projects/dgw_processor/ReqBlockLexer.py", line 423, in ReqBlockLexer
atn = ATNDeserializer().deserialize(serializedATN())
File "/opt/homebrew/lib/python3.10/site-packages/antlr4/atn/ATNDeserializer.py", line 61, in deserialize
self.reset(data)
File "/opt/homebrew/lib/python3.10/site-packages/antlr4/atn/ATNDeserializer.py", line 91, in reset
temp = [ adjust(c) for c in data ]
File "/opt/homebrew/lib/python3.10/site-packages/antlr4/atn/ATNDeserializer.py", line 91, in <listcomp>
temp = [ adjust(c) for c in data ]
File "/opt/homebrew/lib/python3.10/site-packages/antlr4/atn/ATNDeserializer.py", line 89, in adjust
v = ord(c)
TypeError: ord() expected string of length 1, but int found
The Java implementation continues to work fine, but the Python implementation, which has also been working fine before the upgrade to 4.10.1, now throws a TypeError on line 89 in adjust of ATNDeserializer.py
Is this a known bug?
Traceback (most recent call last):
File "/Users/vickery/Projects/dgw_processor/dgw_parser.py", line 15, in <module>
from ReqBlockLexer import ReqBlockLexer
File "/Users/vickery/Projects/dgw_processor/ReqBlockLexer.py", line 421, in <module>
class ReqBlockLexer(Lexer):
File "/Users/vickery/Projects/dgw_processor/ReqBlockLexer.py", line 423, in ReqBlockLexer
atn = ATNDeserializer().deserialize(serializedATN())
File "/opt/homebrew/lib/python3.10/site-packages/antlr4/atn/ATNDeserializer.py", line 61, in deserialize
self.reset(data)
File "/opt/homebrew/lib/python3.10/site-packages/antlr4/atn/ATNDeserializer.py", line 91, in reset
temp = [ adjust(c) for c in data ]
File "/opt/homebrew/lib/python3.10/site-packages/antlr4/atn/ATNDeserializer.py", line 91, in <listcomp>
temp = [ adjust(c) for c in data ]
File "/opt/homebrew/lib/python3.10/site-packages/antlr4/atn/ATNDeserializer.py", line 89, in adjust
v = ord(c)
TypeError: ord() expected string of length 1, but int found
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我没有更新Antlr4-Python3-Runtime。
I had failed to update antlr4-python3-runtime.
您是否会再生词法器和解析器?
当我使用v4.9.2生成代码时,我会有相同的错误。但是,当我将antlr4-python3-runtime更新为v4.10时,该错误已修复。
Did you regenerate your lexers and parsers?
I have the same error when I used v4.9.2 to generate my code. But when I updated antlr4-python3-runtime to v4.10, the error was fixed.