Imgur/imgurpython

File handle not closed properly when uploading from path.

Melanpan opened this issue · 1 comments

Getting the warning ResourceWarning: unclosed file <_io.BufferedReader on Python 3.5.0.

fd = open(path, 'rb')
contents = fd.read()
b64 = base64.b64encode(contents)

fd isn't closed after uploading.

Related ? #45