4.10.1 python atndeserializer损坏了吗?

发布于 2025-01-23 10:35:31 字数 1172 浏览 3 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

表情可笑 2025-01-30 10:35:31

我没有更新Antlr4-Python3-Runtime。

I had failed to update antlr4-python3-runtime.

话少情深 2025-01-30 10:35:31

您是否会再生词法器和解析器?
当我使用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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文