Skip to content

Conversation

@radarhere
Copy link
Member

olefile 0.47 was released in the last day. It has made a change since 0.46, that if it did not open a file pointer, it will no longer close it with close(). This is mentioned on PyPI as 'improved file closure'.

This has broken our file closing tests in the Test and Test Windows workflows for FPX and MIC.

To fix them,

  • for FPX, I have simply kept the original file pointer as self._fp, which is then closed by Image.close() or Image.__exit__().
  • MIC uses TiffImagePlugin which also uses _fp, so I have slightly less simply kept the original file pointer as self.__fp and closed it within MicImagePlugin.

I checked that this still works with olefile 0.46 by downgrading it and observing that it passes on the Test and Test WIndows workflows.

@hugovk
Copy link
Member

hugovk commented Dec 2, 2023

Thanks, let's merge this to get the CI green.

It was the first olefile release in five years. Do you think this might be an olefile bug?

@hugovk hugovk merged commit 2b5c081 into python-pillow:main Dec 2, 2023
@radarhere radarhere deleted the olefile branch December 2, 2023 10:38
@radarhere
Copy link
Member Author

It's not a bug, no, it's decalage2/olefile#121

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants