Skip to content

Bundle fixes - #2060

Open
darbyjohnston wants to merge 5 commits into
AcademySoftwareFoundation:mainfrom
darbyjohnston:bundle-read-fixes
Open

darbyjohnston wants to merge 5 commits into
AcademySoftwareFoundation:mainfrom
darbyjohnston:bundle-read-fixes

Conversation

@darbyjohnston

Copy link
Copy Markdown
Contributor

While testing the new bundle support I found a couple of bugs:

  • The Python adapter did not write version.txt files to .otiod bundles, so we shouldn't throw an error if it is missing. That way older .otiod files remain readable. The new C++ code does write version.txt files to both .otiod and .otioz bundles.
  • The new media reference policy was not being converted with the Python adapters. This fix works with both the old and new media reference names.

🤖 Generated with Claude Code using Claude Opus 5

A bundle is written with a version file, and read_otiod refused to read one
without it. The adapter that wrote otiod bundles before this never wrote
one, so every bundle made until now was refused -- and read_otioz asks for
no such thing, so the two halves of the format disagreed.

The file is still written. It is no longer required to read, and nothing is
lost by that: its contents were never read, only its presence tested.

Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
The policy used to be a string, and the documentation still gives the
commandline for one:

    otioconvert -i in.otio -o out.otioz -A media_policy="AllMissing"

That has not worked since the policy became an enumeration. An adapter
argument off the commandline is always text, and the text went straight to
the enumeration, which does not take it. Neither spelling worked: not
AllMissing, which is documented, nor all_missing, which is what the
enumeration calls it. The policy could not be set from the commandline at
all.

The adapters now read either spelling, which is where it belongs: they are
the edge where untyped arguments arrive. The enumeration stays strict for
everyone who already has a value to pass, and a name that is neither says
so rather than failing as a type error further in.

Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
The Python adapter builds a ReadOptions and calls read_otiod, so the test
walked the bindings into the same code the C++ test covers. Whether a
bundle without a version file reads is settled there.

Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Both bundle adapters call the same conversion, and the otiod test already
covers both spellings and a value that is neither.

Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
@darbyjohnston darbyjohnston changed the title Bundle read fixes Bundle fixes Sep 25, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.69%. Comparing base (e6ca3b7) to head (d507ad4).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2060      +/-   ##
==========================================
+ Coverage   83.52%   83.69%   +0.17%     
==========================================
  Files         182      183       +1     
  Lines       13533    13552      +19     
  Branches     1255     1256       +1     
==========================================
+ Hits        11303    11343      +40     
+ Misses       2057     2036      -21     
  Partials      173      173              
Flag Coverage Δ
py-unittests 83.69% <100.00%> (+0.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/opentimelineio/bundle.cpp 53.14% <ø> (+4.33%) ⬆️
...imelineio/opentimelineio/adapters/bundle_policy.py 100.00% <100.00%> (ø)
...py-opentimelineio/opentimelineio/adapters/otiod.py 85.71% <100.00%> (+1.09%) ⬆️
...py-opentimelineio/opentimelineio/adapters/otioz.py 73.33% <100.00%> (+1.90%) ⬆️
tests/test_otiod.py 94.59% <100.00%> (+3.29%) ⬆️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e6ca3b7...d507ad4. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants