Skip to content

mintinstall.py: Fix NameError when screenshot metadata can't be read - #518

Open
Amadeus-22 wants to merge 1 commit into
linuxmint:masterfrom
Amadeus-22:fix-screenshot-metadata-nameerror
Open

Amadeus-22 wants to merge 1 commit into
linuxmint:masterfrom
Amadeus-22:fix-screenshot-metadata-nameerror

Conversation

@Amadeus-22

Copy link
Copy Markdown

get_screenshot_source_from_metadata() catches GLib.Error and prints a message using ss_path, which is not defined in that function. If query_info() fails (for example the cached screenshot file is gone), the handler itself raises NameError: name 'ss_path' is not defined instead of returning None, and clicking the screenshot to enlarge it does nothing.

The fix uses screenshot.path, the path that was just queried.

Tested on Mint 22.2 by calling the function with a screenshot whose path does not exist:

  • before: NameError: name 'ss_path' is not defined
  • after: prints Could not retrieve source metadata for screenshot (/nonexistent/shot.png): ... and returns None

🤖 Generated with Claude Code

get_screenshot_source_from_metadata() printed ss_path in its GLib.Error
handler, but that name doesn't exist in this function. Use the path of
the screenshot being queried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant