Revert "explicit file regeneration check to screenshot generator"
What changed, and why it matters
This commit reverts a test-only change in the screenshot generator. The original change made the test delete any existing screenshot file before generating it, then verify a new file was actually created. The revert removes that explicit cleanup and verification. This is a testing/quality-of-life change, not a security fix or vulnerability introduction.
No security action required. If maintaining the test suite, consider whether the explicit regeneration check should be reintroduced in a more robust form to catch screenshot generation failures during CI.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The reverted code removed explicit file deletion before screenshot generation and removed a post-generation existence check. The revert restores the previous behavior where the generator simply calls screencap_view() and builds the README without verifying that files were actually regenerated. The affected file is tests/screenshot_generator/generator.py, which is part of the test/documentation tooling, not the runtime SeedSigner firmware or wallet handling code.
Changed components
tests/screenshot_generator/generator.pyInspect captured patch +1 / −14
diff --git a/tests/screenshot_generator/generator.py b/tests/screenshot_generator/generator.py
index d623684..0cc8bfa 100644
--- a/tests/screenshot_generator/generator.py
+++ b/tests/screenshot_generator/generator.py
@@ -479,26 +479,13 @@ def generate_screenshots(locale):
for section_name, screenshot_list in setup_screenshots(locale).items():
subdir = section_name.lower().replace(" ", "_")
- screenshot_section_path = os.path.join(screenshot_root, locale, subdir)
- screenshot_renderer.set_screenshot_path(screenshot_section_path)
+ screenshot_renderer.set_screenshot_path(os.path.join(screenshot_root, locale, subdir))
locale_readme += "\n\n---\n\n"
locale_readme += f"## {section_name}\n\n"
locale_readme += """<table style="border: 0;">"""
locale_readme += f"""<tr><td align="center">"""
for screenshot_config in screenshot_list:
- screenshot_filename = f"{screenshot_config.screenshot_name}.png"
- screenshot_filepath = os.path.join(screenshot_section_path, screenshot_filename)
-
- # Ensure a clean slate. This guarantees we're testing file creation,
- # not just the existence of a stale file from a previous run.
- if os.path.exists(screenshot_filepath):
- os.remove(screenshot_filepath)
-
screencap_view(screenshot_config)
-
- if not os.path.exists(screenshot_filepath):
- raise Exception(f"Failed to generate screenshot for '{screenshot_config.screenshot_name}' in section '{section_name}'.")
-
locale_readme += """ <table align="left" style="border: 1px solid gray;">"""
locale_readme += f"""<tr><td align="center">{screenshot_config.screenshot_name}<br/><br/><img src="{subdir}/{screenshot_config.screenshot_name}.png"></td></tr>"""
locale_readme += """</table>\n"""
Why this scored 12/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.