I'd recommend you change this to use "with", as that automatically handles the close.

with tarfile.open(name=export_file.name, mode='w:gz') as tar_file: