Skip to content

Commit

Permalink
Using bytes instead of str for images payload
Browse files Browse the repository at this point in the history
  • Loading branch information
binrush committed Jan 18, 2016
1 parent 8c79d2a commit a3040e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion images_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
cur.execute("SELECT name, payload FROM images")
for img in cur:
with open(os.path.join(app.config['IMAGES_DIR'], img[0]), 'w') as f:
f.write(str(img[1]))
f.write(bytes(img[1]))
finally:
pool.putconn(conn)

0 comments on commit a3040e7

Please sign in to comment.