[Bug]: Different output upon decoding invalid utf-8
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从报告中的 graalpy -c 解码复现开始,针对提供的无效 UTF-8 字节,将其 errors='replace' 输出与 CPython 进行比较。跟踪解码入口点,确定无效三元组在哪里被分组,然后验证输出是否符合 CPython 的替换行为。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
Not sure whether it is a bug or just a different behaviour.
Not critical either way, but thought filing it for reference anyway.
- When decoding invalid UTF-8 with
errors='replace', CPython (and PyPy for that matter) decodes every invalid byte as�. - GraalPy, OTOH, treats invalid UTF-8 triplets as one character.
Operating system
Linux
CPU architecture
x86_64
GraalPy version
GraalPy 3.12.8 (GraalVM CE Native 25.0.2)
JDK version
No response
Context configuration
No response
Steps to reproduce
GraalPy:
$ graalpy -c "print(b'\xed\xae\x80\xed\xb0\x80'.decode(errors='replace'))"
��
CPython:
$ python -c "print(b'\xed\xae\x80\xed\xb0\x80'.decode(errors='replace'))"
������
Expected behavior
To match CPython unless there is a good reason not to.
Stack trace
Additional context
No response
- 主要语言
- Python
- 星标
- 1.7k
- 派生
- 155
- 平均合并
- 7 小时 16 分钟
- 30 天内合并 PR
- 51
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
oracle/graalpython 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
oracle/graalpython#1105 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
oracle/graalpython#1102 ·
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 74/100
oracle/graalpython#1133 ·
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 68/100
oracle/graalpython#1112 ·
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 68/100
oracle/graalpython#1111 ·
维护者通常 1 天内回复
查看 oracle/graalpython 的全部 Issue
相似的 Issue
-
bug frontend
难度 2/5 1-3 小时 新手友好度 85/100
PedestrianDynamics/pyFDS-Evac#552 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
resend/resend-skills#144 ·
维护者通常 1 天内回复
-
good first issue
难度 1/5 1 小时以内 新手友好度 68/100
-
Bug
难度 2/5 1-3 小时 新手友好度 72/100
GNS3/gns3-server#2935 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
TauricResearch/TradingAgents#1476 ·
维护者通常 2 天内回复