@@ -66,10 +66,10 @@ def _get_member_info(member, encoding):
6666class TarFS (WrapFS ):
6767 """Read and write tar files.
6868
69- There are two ways to open a TarFS for the use cases of reading
69+ There are two ways to open a ` TarFS` for the use cases of reading
7070 a tar file, and creating a new one.
7171
72- If you open the TarFS with ``write`` set to `False` (the
72+ If you open the ` TarFS` with ``write`` set to `False` (the
7373 default), then the filesystem will be a read only filesystem which
7474 maps to the files and directories within the tar file. Files are
7575 decompressed on the fly when you open them.
@@ -79,9 +79,9 @@ class TarFS(WrapFS):
7979 with TarFS('foo.tar.gz') as tar_fs:
8080 readme = tar_fs.readtext('readme.txt')
8181
82- If you open the TarFS with ``write`` set to `True`, then the TarFS
82+ If you open the TarFS with ``write`` set to `True`, then the ` TarFS`
8383 will be a empty temporary filesystem. Any files / directories you
84- create in the TarFS will be written in to a tar file when the TarFS
84+ create in the ` TarFS` will be written in to a tar file when the ` TarFS`
8585 is closed. The compression is set from the new file name but may be
8686 set manually with the ``compression`` argument.
8787
@@ -100,8 +100,9 @@ class TarFS(WrapFS):
100100 use default (`False`) to read an existing tar file.
101101 compression (str, optional): Compression to use (one of the formats
102102 supported by `tarfile`: ``xz``, ``gz``, ``bz2``, or `None`).
103- temp_fs (str): An FS URL for the temporary filesystem
104- used to store data prior to tarring.
103+ temp_fs (str): An FS URL or an FS instance to use to store
104+ data prior to tarring. Defaults to creating a new
105+ `~fs.tempfs.TempFS`.
105106
106107 """
107108
@@ -118,7 +119,7 @@ def __new__( # type: ignore
118119 write = False , # type: bool
119120 compression = None , # type: Optional[Text]
120121 encoding = "utf-8" , # type: Text
121- temp_fs = "temp://__tartemp__" , # type: Text
122+ temp_fs = "temp://__tartemp__" , # type: Union[ Text, FS]
122123 ):
123124 # type: (...) -> FS
124125 if isinstance (file , (six .text_type , six .binary_type )):
@@ -164,7 +165,7 @@ def __init__(
164165 file , # type: Union[Text, BinaryIO]
165166 compression = None , # type: Optional[Text]
166167 encoding = "utf-8" , # type: Text
167- temp_fs = "temp://__tartemp__" , # type: Text
168+ temp_fs = "temp://__tartemp__" , # type: Union[ Text, FS]
168169 ): # noqa: D107
169170 # type: (...) -> None
170171 self ._file = file # type: Union[Text, BinaryIO]
0 commit comments