<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: "Calibri", "Helvetica", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Christopher, Elena, Christoph,</div>
<div class="elementToProof" style="font-family: "Calibri", "Helvetica", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Calibri", "Helvetica", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I have pushed a small refinement to the patch on salsa. The changes are:</div>
<div class="elementToProof" style="font-family: "Calibri", "Helvetica", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Calibri", "Helvetica", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
- 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.</div>
<div class="elementToProof" style="font-family: "Calibri", "Helvetica", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
- Format conversion fix: replaced `img.format or "png"` with `self.format` in the fallback path, preventing silent JPEG/GIF-to-PNG conversion.</div>
<div class="elementToProof" style="font-family: "Calibri", "Helvetica", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
- `except Exception` narrowed to `except OSError` on `fp.close()`.</div>
<div class="elementToProof" style="font-family: "Calibri", "Helvetica", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Calibri", "Helvetica", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Both the original and refined patch pass all 10 tests; unpatched 3.1.5 fails on the two BytesIO double-save cases as expected.</div>
<div class="elementToProof" style="font-family: "Calibri", "Helvetica", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Calibri", "Helvetica", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Also, Alexandre Detiste has granted me upload rights for this package, so I can upload directly if everyone is happy with the patch.</div>
<div class="elementToProof" style="font-family: "Calibri", "Helvetica", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Calibri", "Helvetica", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Cheers,</div>
<div style="font-family: "Calibri", "Helvetica", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Josenilson</div>
</body>
</html>