Bug#1132566:

Nilson Silva nilsonfsilva at hotmail.com
Thu May 7 11:35:20 BST 2026


Hi Christopher, Elena, Christoph,

I have pushed a small refinement to the patch on salsa. The changes are:

- Cache moved to `__init__`: bytes from file-like sources are now stored at construction time, not lazily on first save. This closes the window where a second save could fail if the handle was closed before any save occurred.
- Format conversion fix: replaced `img.format or "png"` with `self.format` in the fallback path, preventing silent JPEG/GIF-to-PNG conversion.
- `except Exception` narrowed to `except OSError` on `fp.close()`.

Both the original and refined patch pass all 10 tests; unpatched 3.1.5 fails on the two BytesIO double-save cases as expected.

Also, Alexandre Detiste has granted me upload rights for this package, so I can upload directly if everyone is happy with the patch.

Cheers,
Josenilson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20260507/ae300504/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_bug1132566.py
Type: text/x-python
Size: 12530 bytes
Desc: test_bug1132566.py
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20260507/ae300504/attachment-0001.py>


More information about the debian-science-maintainers mailing list