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

Updated TIFF decode error message string #8660

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HarmvandenBrand
Copy link

@HarmvandenBrand HarmvandenBrand commented Jan 3, 2025

OSError caused by decode error should use string argument to be in line with rest of module

Changes proposed in this pull request:

  • Changed an OSError raised in TiffImagePlugin.py during a decoder error to contain a str message as its argument, instead of directly passing the error code as an integer. This change brings this specific OSError in line with the way errors are raised in the rest of TiffImagePlugin.py and thus reduces surprise.

@radarhere radarhere added the TIFF label Jan 3, 2025
@HarmvandenBrand HarmvandenBrand marked this pull request as ready for review January 3, 2025 11:15
@radarhere radarhere changed the title OSError caused by decode error should use string argument to be in li… Updated TIFF decode error message string Jan 3, 2025
@radarhere
Copy link
Member

Nitpick suggestion: maybe remove the colon, to more closely match

if errcode < 0:
msg = f"encoder error {errcode} when writing image file"
raise OSError(msg)

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants