Skip to content

fix: narrow file picker data fallback errors - #146

Merged
petercorke merged 4 commits into
petercorke:mainfrom
RoboX2020:fix/file-picker-fallback-errors
Oct 17, 2026
Merged

petercorke merged 4 commits into
petercorke:mainfrom
RoboX2020:fix/file-picker-fallback-errors

Conversation

@RoboX2020

Copy link
Copy Markdown
Contributor

Addresses the data-directory fallback in #115's base/imageio.py group.

The file picker falls back to the home directory only for ModuleNotFoundError (missing data package) or ValueError (data path not found), matching the resolver's actual failure modes. Unexpected resolver failures now propagate instead of being silently hidden.

Five adapter tests cover the resolved data directory, both supported fallbacks, RuntimeError propagation and KeyboardInterrupt propagation. The RuntimeError regression fails on the original implementation.

Validation on Python 3.11:

  • New tests: 5 passed on OpenCV 4.12.0.88 and 5.0.0.93.
  • Full OpenCV 5 suite: 964 passed, 97 skipped, 5 subtests passed.
  • New tests pass ruff and black.

Tests replace the tkinter dialog with an adapter; no real desktop file picker was opened. Full suite on OpenCV 4 was not run. Other #115 sites remain separate.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 4 complexity · 0 duplication

Metric Results
Complexity 4
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@petercorke
petercorke merged commit 77a3da9 into petercorke:main Oct 17, 2026
37 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 17, 2026
@petercorke

Copy link
Copy Markdown
Owner

Thanks — narrowing the fallback to ModuleNotFoundError/ValueError matches what mvtb_path_to_datafile raises. Merged.

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