Get file size from "Content-Length" value from a file in python 3.2
It looks like you are using Python 3, and have read some code / documentation for Python 2.x. It is poorly documented, but there is no getheaders
method in Python 3, but only a get_all
method.
See this bug report.
Change final line to:
file_size = int(meta.get_all("Content-Length")[0])