You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
docker-to-squash.py does not run on Python 3 #9291
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_hash passes str(out) to sha.update and raises TypeError: Strings must be encoded before hashing. pull-build, pull-build-push-update, push-update, and add-tag hit this, and so do query-tag and copy-update when they find the tag.
write_local_image_tag_to_hash uses hash_to_tags.iteritems(), so commands that write the tag mapping (for example remove-tag) raise AttributeError.
get_all_known_images calls bytes.split(...), so remove-image and cleanup raise TypeError. Those functions also call long() later on.
read_image_tag_to_hash does str(line) on bytes, so t1:<hash>\n becomes b't1:<hash>\n'. Lines without a #comment fail the sha256 check and are dropped; lines with one keep a b' prefix on the first tag. query-tag and copy-update then miss the existing tag.
convert_oci_whiteouts does str(out).splitlines(), which joins the paths into one string, so no whiteout is converted. The failed commands are also hidden by the shell_command issue.
Once Iterable and long are patched, list-tags and bootstrap run to completion.
Follow-up from the review discussion in #9284 ʕ•ᴥ•ʔ
Activity
Address review: hash raw bytes, decode subprocess output, replace rem…
Address review: hash raw bytes, decode subprocess output, replace rem…