docker-to-squash.py does not run on Python 3
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 54/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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 ʕ•ᴥ•ʔ
- Dominant language
- Java
- Stars
- 6.7k
- Forks
- 4k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 86
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/storm
-
docker-to-squash.py: check_dependencies should find mksquashfs on PATHPossibly taken @linzch3 claimed this today. Open
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
docker-to-squash.py: get_working_dir creates a new directory on every call, so push-update cannot find pulled imagesPossibly taken @linzch3 claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
apache/storm#9155 · 4 comments ·
Maintainers usually reply within 1 day
-
Kafka spout cannot commit past a message that always fails to deserializePossibly taken @linzch3 claimed this 10 days ago. Openbug
Difficulty 5/5 Over a week Newbie friendliness 35/100
apache/storm#9078 · 4 comments ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
apache/storm#9077 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
feature request needs triage
Difficulty 1/5 Under an hour Newbie friendliness 66/100
TeamNewPipe/NewPipe#14083 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
PCL-Community/PCL-CE#3907 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 2 days
-
`B3PropagatorExtractorMultipleHeaders` allocates when headers are missingPossibly taken @Eliot5566 claimed this today. OpenBug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
open-telemetry/opentelemetry-java#9065 ·
Maintainers usually reply within 3 days
-
area/dependencies area/dependencies/quarkus backport/26.6 backport/26.8 kind/cve severity/critical source/scan-dependencies status/triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days