better to use ``contextlib.closing`` or at least a ``try`` .. ``finally`` to close the ``tar_file`` in case the ``add`` call goes wrong.