docker-to-squash.py does not run on Python 3
维护者通常 1 天内回复
评估
调研方向
Start with bin/docker-to-squash.py, especially the named functions and argument declarations: calculate_string_hash, read_image_tag_to_hash, write_local_image_tag_to_hash, convert_oci_whiteouts, and get_all_known_images. Run the reported python3 bin/docker-to-squash.py --help reproduction, then exercise the listed subcommands to check Python 3 behavior. Done means argument parsing and the affected commands work on Python 3, including byte handling and tag mapping.
由索引模型根据 Issue 内容生成。
描述
bin/docker-to-squash.py still uses Python 2 APIs and treats subprocess output (bytes) as str, so on Python 3 no subcommand gets past argument parsing.
Storm 3.3.0-SNAPSHOT (master 4fca209). Reproduced with Python 3.9, 3.10, and 3.13.
$ python3 bin/docker-to-squash.py --help
ImportError: cannot import name 'Iterable' from 'collections'
That comes from from collections import Iterable, which was removed in Python 3.10. On Python 3.9 the import succeeds, but --untagged-transition-sec is declared with type=long, and building the parser raises NameError: name 'long' is not defined.
Expected: the script imports, parses arguments, and runs subcommands on Python 3.
Actual: it fails as above before any subcommand runs. With those two patched, later calls still fail:
calculate_string_hashpassesstr(out)tosha.updateand raisesTypeError: Strings must be encoded before hashing.pull-build,pull-build-push-update,push-update, andadd-taghit this, and so doquery-tagandcopy-updatewhen they find the tag.write_local_image_tag_to_hashuseshash_to_tags.iteritems(), so commands that write the tag mapping (for exampleremove-tag) raiseAttributeError.get_all_known_imagescallsbytes.split(...), soremove-imageandcleanupraiseTypeError. Those functions also calllong()later on.read_image_tag_to_hashdoesstr(line)on bytes, sot1:<hash>\nbecomesb't1:<hash>\n'. Lines without a#commentfail the sha256 check and are dropped; lines with one keep ab'prefix on the first tag.query-tagandcopy-updatethen miss the existing tag.convert_oci_whiteoutsdoesstr(out).splitlines(), which joins the paths into one string, so no whiteout is converted. The failed commands are also hidden by theshell_commandissue.
Once Iterable and long are patched, list-tags and bootstrap run to completion.
Follow-up from the review discussion in #9284 ʕ•ᴥ•ʔ
- 主要语言
- Java
- 星标
- 6.7k
- 派生
- 4k
- 平均合并
- 1 天 5 小时
- 30 天内合并 PR
- 86
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/storm 的其他 Issue
-
docker-to-squash.py: check_dependencies should find mksquashfs on PATH可能已有人在做 @linzch3 今天认领。 未关闭
难度 1/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
docker-to-squash.py: get_working_dir creates a new directory on every call, so push-update cannot find pulled images可能已有人在做 @linzch3 于 5 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 30/100
维护者通常 1 天内回复
-
Kafka spout cannot commit past a message that always fails to deserialize可能已有人在做 @linzch3 于 10 天前认领。 未关闭bug
难度 5/5 一周以上 新手友好度 35/100
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 68/100
PCL-Community/PCL-CE#3907 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
维护者通常 2 天内回复
-
area/dependencies area/dependencies/quarkus backport/26.6 backport/26.8 kind/cve severity/critical source/scan-dependencies status/triage
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
chore
难度 1/5 1-3 小时 新手友好度 88/100
lugassawan/swe-workbench#841 ·
-
needs-triage
难度 2/5 1-3 小时 新手友好度 78/100
EndlessPixel-Studio/FakePlayer-CE#155 ·
维护者通常 1 天内回复