gluonts.util module#

gluonts.util.safe_extractall(tar: tarfile.TarFile, path: pathlib.Path = PosixPath('.'), members=None, *, numeric_owner=False)[source]#

Safe wrapper around TarFile.extractall that checks all destination files to be strictly within the given path.

gluonts.util.will_extractall_into(tar: tarfile.TarFile, path: pathlib.Path) None[source]#

Check that the content of tar will be extracted within path upon calling extractall. Raise a PermissionError if not.