base_url,
ilustr.get('src')
)
- with six.moves.urllib.request.urlopen(url) as imgfile:
- img = Image.open(imgfile)
+ imgfile = six.moves.urllib.request.urlopen(url)
+ img = Image.open(imgfile)
th_format, ext, media_type = {
'GIF': ('GIF', 'gif', 'image/gif'),
th.save(os.path.join(temp, file_name))
ilustr.set('src', file_name)
+ imgfile.close()
+
for sponsor in book_info.sponsors:
ins = etree.Element("data-sponsor", name=sponsor)
logo = sponsor_logo(sponsor)