Message320075
Extract of tartest.py:
tarfile.open(name=_tmp_tar, mode='w', bufsize=EXPECTED_SIZE)
Hum, the bufsize argument only applies to the "...|compression" modes (ex: "w|gz"). Moreover, it shouldn't change the size of the tarfile, it only changes the size of parameters of read() and write() arguments.
Extract of Stream.__write():
while len(self.buf) > self.bufsize:
self.fileobj.write(self.buf[:self.bufsize])
self.buf = self.buf[self.bufsize:]
> Trying to create an archive with the tarfile module, by specifying a different blocking factor, (...)
I didn't know that we can change the "blocking factor". In the UNIX tar command, I see the -b option:
-b, --blocking-factor=BLOCKS
Set record size to BLOCKSx512 bytes.
In Lib/tarfile.py, I see:
BLOCKSIZE = 512 # length of processing blocks
RECORDSIZE = BLOCKSIZE * 20 # length of records
So values are hardcoded in Python.
So this issue is a feature request, not a bug report :-) |
|
| Date |
User |
Action |
Args |
| 2018-06-20 13:04:55 | vstinner | set | recipients:
+ vstinner, lars.gustaebel, cstratak, nitishch |
| 2018-06-20 13:04:55 | vstinner | set | messageid: <1529499895.38.0.56676864532.issue31774@psf.upfronthosting.co.za> |
| 2018-06-20 13:04:55 | vstinner | link | issue31774 messages |
| 2018-06-20 13:04:55 | vstinner | create | |
|