File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -109,10 +109,12 @@ Some facts and figures:
109109 ``'filemode|[compression]' ``. :func: `tarfile.open ` will return a :class: `TarFile `
110110 object that processes its data as a stream of blocks. No random seeking will
111111 be done on the file. If given, *fileobj * may be any object that has a
112- :meth: `~io.TextIOBase.read ` or :meth: `~io.TextIOBase.write ` method (depending on the *mode *). *bufsize *
113- specifies the blocksize and defaults to ``20 * 512 `` bytes. Use this variant
114- in combination with e.g. ``sys.stdin ``, a socket :term: `file object ` or a tape
115- device. However, such a :class: `TarFile ` object is limited in that it does
112+ :meth: `~io.RawIOBase.read ` or :meth: `~io.RawIOBase.write ` method
113+ (depending on the *mode *) that works with bytes.
114+ *bufsize * specifies the blocksize and defaults to ``20 * 512 `` bytes.
115+ Use this variant in combination with e.g. ``sys.stdin.buffer ``, a socket
116+ :term: `file object ` or a tape device.
117+ However, such a :class: `TarFile ` object is limited in that it does
116118 not allow random access, see :ref: `tar-examples `. The currently
117119 possible modes:
118120
Original file line number Diff line number Diff line change @@ -332,10 +332,11 @@ def write(self, s):
332332class _Stream :
333333 """Class that serves as an adapter between TarFile and
334334 a stream-like object. The stream-like object only
335- needs to have a read() or write() method and is accessed
336- blockwise. Use of gzip or bzip2 compression is possible.
337- A stream-like object could be for example: sys.stdin,
338- sys.stdout, a socket, a tape device etc.
335+ needs to have a read() or write() method that works with bytes,
336+ and the method is accessed blockwise.
337+ Use of gzip or bzip2 compression is possible.
338+ A stream-like object could be for example: sys.stdin.buffer,
339+ sys.stdout.buffer, a socket, a tape device etc.
339340
340341 _Stream is intended to be used only internally.
341342 """
You can’t perform that action at this time.
0 commit comments