dr. Sybren is een gebruiker op mstdn.nl. Je kunt deze volgen of interactie mee hebben als je ergens in deze Fediverse een account hebt. Als je dat niet hebt, kun je je hier aanmelden.
dr. Sybren @sybren

@monsterjavaguns I was reading up on opensource.com/article/17/2/py, good stuff. You do want to remove the catching of SyntaxError, though. That exception would indicate that there is an actual syntax error in your Python code -- that's not the kind of thing you want to handle as synonym for "this image is corrupt".

I've looked up the Pillow documentation, but they don't say which exceptions they use. Did you see them actually throw a SyntaxError?

jun 16, %J, 24:22 · Web · 1 · 1

@sybren Good catch. I've had an image throw a SyntaxError once... but I think I was doing something pretty unconventional with it (the image, that is). As such, I'd simply left the catch in my own code... and it found its way into the article. Suppose I should probably fix that.