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

[MRG] Fix Pillow raising AttributeError due to Image.mode being read-only #1908

Merged
merged 5 commits into from
Oct 16, 2023

Conversation

scaramallion
Copy link
Member

@scaramallion scaramallion commented Oct 15, 2023

Describe the changes

Pillow 10.1 changed the Image.mode property to be read-only, with Image._mode intended to be read-write.

Closes #1907

Tasks

  • Fix or feature added
  • Documentation updated (if relevant)
  • Unit tests passing and overall coverage the same or better

@scaramallion
Copy link
Member Author

The Image._mode attribute was added in 10.1, previously it was just an Image.mode attribute, which has been changed to a property getter only.

@scaramallion scaramallion changed the title [WIP] Fix Pillow raising AttributeError due to Image.mode being read-only [MRG] Fix Pillow raising AttributeError due to Image.mode being read-only Oct 15, 2023
@codecov
Copy link

codecov bot commented Oct 15, 2023

Codecov Report

Merging #1908 (10a2551) into main (c997ce1) will decrease coverage by 0.01%.
Report is 1 commits behind head on main.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##             main    #1908      +/-   ##
==========================================
- Coverage   97.75%   97.74%   -0.01%     
==========================================
  Files          63       63              
  Lines       10716    10720       +4     
==========================================
+ Hits        10475    10478       +3     
- Misses        241      242       +1     
Files Coverage Δ
src/pydicom/valuerep.py 99.27% <100.00%> (+<0.01%) ⬆️
src/pydicom/pixel_data_handlers/pillow_handler.py 95.28% <66.66%> (-0.88%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@darcymason darcymason merged commit 89b2fca into pydicom:main Oct 16, 2023
8 of 9 checks passed
@scaramallion scaramallion deleted the fix-pillow branch October 16, 2023 20:46
@radarhere
Copy link
Contributor

I've created #1912 as a possible different way of solving #1907

bertptrs added a commit to bertptrs/aur that referenced this pull request Jan 5, 2024
upstream release

Implement patch from pydicom/pydicom#1908 to
deal with newer Pillow version in arch repos
archlinux-github pushed a commit to archlinux/aur that referenced this pull request Jan 5, 2024
upstream release

Implement patch from pydicom/pydicom#1908 to
deal with newer Pillow version in arch repos
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.

Exception with Pillow 10.1+ Image.mode is read-only
4 participants