@@ -618,22 +618,23 @@ provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules.
618618
619619 Create an archive file (such as zip or tar) and return its name.
620620
621- *base_name * is the name of the file to create, including the path, minus
622- any format-specific extension.
621+ *base_name * is a string or :term: ` path-like object ` specifying the name of
622+ the file to create, including the path, minus any format-specific extension.
623623
624624 *format * is the archive format: one of
625625 "zip" (if the :mod: `zlib ` module is available), "tar", "gztar" (if the
626626 :mod: `zlib ` module is available), "bztar" (if the :mod: `bz2 ` module is
627627 available), "xztar" (if the :mod: `lzma ` module is available), or "zstdtar"
628628 (if the :mod: `compression.zstd ` module is available).
629629
630- *root_dir * is a directory that will be the root directory of the
631- archive, all paths in the archive will be relative to it; for example,
632- we typically chdir into *root_dir * before creating the archive.
630+ *root_dir * is a string or :term: `path-like object ` specifying a directory
631+ that will be the root directory of the archive, all paths in the archive
632+ will be relative to it; for example, we typically chdir into *root_dir *
633+ before creating the archive.
633634
634- *base_dir * is the directory where we start archiving from;
635- i.e. *base_dir * will be the common prefix of all files and
636- directories in the archive. *base_dir * must be given relative
635+ *base_dir * is a string or :term: ` path-like object ` specifying a directory
636+ where we start archiving from; i.e. *base_dir * will be the common prefix of
637+ all files and directories in the archive. *base_dir * must be given relative
637638 to *root_dir *. See :ref: `shutil-archiving-example-with-basedir ` for how to
638639 use *base_dir * and *root_dir * together.
639640
@@ -668,6 +669,10 @@ provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules.
668669 This function is now made thread-safe during creation of standard
669670 ``.zip `` and tar archives.
670671
672+ .. versionchanged :: next
673+ Accepts a :term: `path-like object ` for *base_name *, *root_dir * and
674+ *base_dir *.
675+
671676.. function :: get_archive_formats()
672677
673678 Return a list of supported formats for archiving.
0 commit comments