Commit 74784843 authored by Saul Ibarra's avatar Saul Ibarra

Fix opening avatar files in binary format

parent 2702e470
......@@ -94,7 +94,8 @@ class IconManager(object):
pixmap = QPixmap()
filename = ApplicationData.get(os.path.join('images', id + '.png'))
try:
data = file(filename).read()
with open(filename, 'rb') as f:
data = f.read()
except (IOError, OSError):
data = None
if data is not None and pixmap.loadFromData(data):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment