File tree 2 files changed +11
-8
lines changed
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:
109
109
``'filemode|[compression]' ``. :func: `tarfile.open ` will return a :class: `TarFile `
110
110
object that processes its data as a stream of blocks. No random seeking will
111
111
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
116
118
not allow random access, see :ref: `tar-examples `. The currently
117
119
possible modes:
118
120
Original file line number Diff line number Diff line change @@ -332,10 +332,11 @@ def write(self, s):
332
332
class _Stream :
333
333
"""Class that serves as an adapter between TarFile and
334
334
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.
339
340
340
341
_Stream is intended to be used only internally.
341
342
"""
You can’t perform that action at this time.
0 commit comments