# HG changeset patch # User Ludovic Chabant # Date 1532293675 25200 # Node ID 169aa24a8442bd4392bb62fc7d5761d7151a39ab # Parent a1b7a459326a3eb20d53be97a65deea287a3660f Fix Mastodon photo posting. diff -r a1b7a459326a -r 169aa24a8442 silorider/silos/mastodon.py --- a/silorider/silos/mastodon.py Wed Jul 18 20:46:04 2018 -0700 +++ b/silorider/silos/mastodon.py Sun Jul 22 14:07:55 2018 -0700 @@ -141,7 +141,8 @@ tmpfile, headers = urllib.request.urlretrieve(url) logger.debug("Using temporary file: %s" % tmpfile) - return self.client.media_post(tmpfile, mt) + with open(tmpfile, 'rb') as tmpfp: + return self.client.media_post(tmpfp, mt) finally: logger.debug("Cleaning up.") urllib.request.urlcleanup()