'Tarfile with file that extracts to edx-platform directory.
Extracting this tarfile in directory <dir> will also put its contents
directly in <dir> (rather than <dir/tarname>).'

def _edx_platform_tar(self):

    outside_tar = (self.unsafe_common_dir / 'unsafe_file.tar.gz')
    with tarfile.open(outside_tar, 'w:gz') as tar:
        tar.addfile(tarfile.TarInfo(os.path.join(os.path.abspath('.'), 'a_file')))
    return outside_tar
