Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when logging incorrect sized images #15

Open
PhasecoreX opened this issue Apr 30, 2022 · 0 comments
Open

Error when logging incorrect sized images #15

PhasecoreX opened this issue Apr 30, 2022 · 0 comments

Comments

@PhasecoreX
Copy link
Contributor

Looks like an error is happening when it tries to log that an image wasn't the correct size:

INFO:root:Processing app ID 677620 : Splitgate
INFO:root:Extracting icon(s) from /home/phasecorex/.var/app/com.valvesoftware.Steam/.local/share/Steam/steam/games/6bed647ef2dd5e8673acd068fd5b9dc934eba9d6.ico
/home/phasecorex/.venv/steam-desktop-updater/venv/lib/python3.10/site-packages/PIL/IcoImagePlugin.py:316: UserWarning: Image was not the expected size
  warnings.warn("Image was not the expected size")
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.10/logging/__init__.py", line 1100, in emit
    msg = self.format(record)
  File "/usr/lib/python3.10/logging/__init__.py", line 943, in format
    return fmt.format(record)
  File "/usr/lib/python3.10/logging/__init__.py", line 678, in format
    record.message = record.getMessage()
  File "/usr/lib/python3.10/logging/__init__.py", line 368, in getMessage
    msg = msg % self.args
TypeError: %i format: a real number is required, not tuple
Call stack:
  File "/home/phasecorex/.venv/steam-desktop-updater/program/steam_desktop_updater.py", line 293, in <module>
    create_desktop_data(steam_root=args.steam_root, destdir=args.datatir, steam_cmd=args.steam_command)
  File "/home/phasecorex/.venv/steam-desktop-updater/program/steam_desktop_updater.py", line 279, in create_desktop_data
    app.extract_icons(destdir)
  File "/home/phasecorex/.venv/steam-desktop-updater/program/steam_desktop_updater.py", line 116, in extract_icons
    icon_file.extract(destdir)
  File "/home/phasecorex/.venv/steam-desktop-updater/program/steam_desktop_updater.py", line 191, in extract
    logging.warning('Expected size %ix%i, got %ix%i', size, size, h, w)
Message: 'Expected size %ix%i, got %ix%i'
Arguments: ((256, 256), (256, 256), 512, 512)

The variable size isn't the integer 256, it's a tuple of (256, 256), which then breaks the logging formatter.

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

No branches or pull requests

1 participant