tarfile.TarFile.extract()

TarFile.extract(member, path="", set_attrs=True, *, numeric_owner=False)

Extract a member from the archive to the current working directory, using its full name. Its file information is extracted as accurately as possible. member may be a filename or a TarInfo object. You can specify a different directory using path. File attributes (owner, mtime, mode) are set unless set_attrs is false.

If numeric_owner is True, the uid and gid numbers from the tarfile are used to set the owner/group for the extracted files. Otherwise, the named values from the tarfile are used.

Note

The extract() method does not take care of several extraction issues. In most cases you should consider using the extractall() method.

Warning

See the warning for extractall().

Changed in version 3.2: Added the set_attrs parameter.

Changed in version 3.5: Added the numeric_only parameter.

doc_python
2016-10-07 17:44:09
Comments
Leave a Comment

Please login to continue.