I had a similar error and it was associated with the path and the way you open the file and write to it. Set your path to the following:
path = os.path.join(os.path.dirname(os.path.realpath(__file__)),"temp","report.csv")
This basically sets the path to: /path/to/your/python/script/TEMP/report.csv
If your temp folder or report.csv file do not exist, they will be created during the process.
After that you need to open the file, write to it, and close it. The following script can do that:
f = open(path,'wb')
f.write(report_downloader.DownloadReport(report))
f.close()
So you are basically running a download command directly into the open file and then closing it.
Hope this helps!
Aivoric