as-jvm failed for a returned list
还没有人认领这个 Issue。
评估
调研方向
首先使用 libpython-clj、py/as-list 和 Cheshire 的 json/generate-string,根据报告中的 snippet 重现该问题,然后将返回的列表与正常工作的 map 情况进行比较。Issue 中链接的演示仓库包含额外的重现上下文。完成的标准是确定列表为何以错误的形式到达 Cheshire,并确认返回的列表可以编码为 JSON,而不会出现报告中的 ClassCastException。
由索引模型根据 Issue 内容生成。
描述
Hi,
I experienced an issue while I was using libpython-clj to encode the returned list as json via cheshire, it threw an exception with this snippet:
(println "Just something interesting from Python:"
(-> (py/py. simple a_list)
py/as-list
json/generate-string))
The exception:
Execution error (ClassCastException) at cheshire.generate/generate$fn (generate.clj:135).
class java.lang.String cannot be cast to class java.util.Map$Entry (java.lang.String and java.util.Map$Entry are in module java.base of loader 'bootstrap')
And it worked fine for a map.
I've created a demo repo for this: https://github.com/whatacold/libpython-clj-as-jvm-issue, hopefully I've put all necessary info there.
Was there something I was missing? Thanks.
- 主要语言
- Clojure
- 星标
- 1.2k
- 派生
- 74
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
clj-python/libpython-clj 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 48/100
clj-python/libpython-clj#280 ·
-
难度 4/5 3-5 天 新手友好度 38/100
clj-python/libpython-clj#275 · 5 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 58/100
clj-python/libpython-clj#273 ·
-
难度 4/5 3-5 天 新手友好度 25/100
clj-python/libpython-clj#271 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
clj-python/libpython-clj#270 · 1 条评论 ·
查看 clj-python/libpython-clj 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 90/100
-
难度 1/5 1 小时以内 新手友好度 88/100
-
.Team/Metabot Priority:P3
难度 2/5 1-3 小时 新手友好度 72/100
-
needs triage
难度 1/5 1 小时以内 新手友好度 90/100
-
难度 2/5 1-3 小时 新手友好度 78/100
scalar-labs/scalar-jepsen#222 · 1 条评论 ·