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

Fixed incorrect operator in ImageCms error #6370

Merged
merged 7 commits into from Jun 19, 2022

Conversation

LostBenjamin
Copy link
Contributor

Hi,

This pull request is a fix to a potential wrong operator bug at src/PIL/ImageCms.py. Please check the changes.

Best,
Jingxuan

@hugovk
Copy link
Member

hugovk commented Jun 15, 2022

Thanks for the PR. Please could you add a test for this? And let's also use an f-string.

@LostBenjamin
Copy link
Contributor Author

You are welcome.

This bugs was found by our automated tool statically. I am not familiar with the codebase so it would be difficult for me to write a test case.

@hugovk
Copy link
Member

hugovk commented Jun 15, 2022

That's fine, I've added tests, thanks!

Tests/test_imagecms.py Outdated Show resolved Hide resolved
We get "an integer is required (got type NoneType)" with Python 3.7-3.9 on Windows.

We get "'NoneType' object cannot be interpreted as an integer" with Python 3.10 on Windows and all versions on macOS and Ubuntu.
@hugovk hugovk changed the title Fix a potential wrong operator bug Fix wrong operator bug in PyCMSError exception message Jun 19, 2022
Tests/test_imagecms.py Outdated Show resolved Hide resolved
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
@radarhere radarhere added the automerge Automatically merge PRs that are ready label Jun 19, 2022
@mergify mergify bot merged commit 8de74b9 into python-pillow:main Jun 19, 2022
@radarhere radarhere changed the title Fix wrong operator bug in PyCMSError exception message Fixed incorrect operator in ImageCms error Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PRs that are ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants