python-pillow / Pillow

Python Imaging Library (Fork)
https://python-pillow.org
Other
12.32k stars 2.23k forks source link

Do not repeatedly save to the same path #8512

Closed radarhere closed 3 weeks ago

radarhere commented 3 weeks ago

https://github.com/tonybaloney/pytest-freethreaded/issues/11 noted a segfault that can occur under free-threading with Tests/test_file_jpeg.py::test_qtables. I can replicate this with --require-gil-disabled - https://github.com/radarhere/Pillow/actions/runs/11572743510

Changing the test to save to a BytesIO instance rather than writing repeatedly to the same temporary path fixes this specific test - https://github.com/radarhere/Pillow/actions/runs/11572819452