Skip to content

Conversation

imerr
Copy link

@imerr imerr commented Jan 25, 2025

PR to upgrade to python3 - companion to ArchiveTeam/archiveteam-megawarc-factory#20, fixes #3

Changes:

  • Ports the megawarc script to python3
    • Initial conversion with 2to3
    • Manual fixes of mostly encoding errors, everything relevant should be handled as byte strings now
    • Removes ordereddict.py shim for old python versions (it is included in all modern ones)
    • megawarc-fix script has not been modified past 2to3 and been deprecated & moved to old/ - please do let me know if a port is required and I can get on that - I don't think our tooling uses it currently though.
  • Adds a simple test suite based on real world data with result verification based on the current python2 version.
    • Test runs with code coverage. Currently 83% are covered (only leaving out some utilities and error handling)
    • Test data comparison notes:
      • The tar header format has changed and there is a few other fields I am ignoring in the meta json comparison (since e.g. the user/group ids are based on what is running the test)
      • gzip includes timestamps in headers and is not reproducible, so I am extracting and checksumming the extracted files instead
  • fixes the previously broken convert command (bad unpack handling, likely happened when adding zst support - did not look into it further though)

Todo:

  • Complete pass over megawarc to catch any string encoding issues
  • Test functionality other than packing a megawarc
  • Add test suite data after review
  • Run tests on CI (?)

@imerr imerr marked this pull request as ready for review April 8, 2025 15:20
@imerr imerr force-pushed the feat/upgrade-to-python3 branch from f96e375 to acf1ac9 Compare August 2, 2025 15:55
@imerr imerr force-pushed the feat/upgrade-to-python3 branch from 4b9072b to 18883de Compare August 2, 2025 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

move to Python 3
1 participant