diff --git a/gajim/gui_interface.py b/gajim/gui_interface.py index 492b5da69..71f849c79 100644 --- a/gajim/gui_interface.py +++ b/gajim/gui_interface.py @@ -2443,7 +2443,9 @@ class Interface: 'loading avatar %s failed. Try to convert ' 'avatar image using pillow', filename) try: - avatar = Image.open(path).convert("RGBA") + with open(path, 'rb') as im_handle: + img = Image.open(im_handle) + avatar = img.convert("RGBA") except (NameError, OSError): app.log('avatar').warning('Pillow convert failed: %s', filename) app.log('avatar').debug('Error', exc_info=True)