Skip to content

Conversation

@Tomo1151
Copy link

@Tomo1151 Tomo1151 commented Dec 18, 2025

Description

This pull request fixes an AttributeError: 'Logger' object has no attribute 'warn' that occurs during inference.

In Python 3.13, the warn() method has been removed, leading to a crash. Replacing it with warning(), the standard recommended method, resolves this issue and ensures the tool remains usable in modern environments.

Changes

  • Updated src/sharp/utils/io.py: Changed LOGGER.warn() to LOGGER.warning().
  • Verified using grep -r --include="*.py" "\.warn(" . that no other occurrences of .warn() exist within the src directory.

Impact

This is a non-breaking change that prevents the application from crashing when EXIF data (focal length) is missing from input images.

Testing

  • Verified the fix by running the prediction CLI. The error no longer occurs, and the fallback message is correctly logged using .warning().

By submitting this pull request, I represent that I have the right to license my contribution to Apple and the community, and agree that my contributions are licensed under the LICENSE of this repository.

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