mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Replace KB unit with KiB (#4293)
kB (*kilo* byte) unit means 1000 bytes, whereas KiB ("kibibyte")
means 1024 bytes. KB was misused: replace kB or KB with KiB when
appropriate.
Same change for MB and GB which become MiB and GiB.
Change the output of Tools/iobench/iobench.py.
Round also the size of the documentation from 5.5 MB to 5 MiB.
This commit is contained in:
parent
0e163d2ced
commit
8c663fd60e
38 changed files with 76 additions and 76 deletions
|
|
@ -779,12 +779,12 @@ class Bz2DetectReadTest(Bz2Test, DetectReadTest):
|
|||
def test_detect_stream_bz2(self):
|
||||
# Originally, tarfile's stream detection looked for the string
|
||||
# "BZh91" at the start of the file. This is incorrect because
|
||||
# the '9' represents the blocksize (900kB). If the file was
|
||||
# the '9' represents the blocksize (900,000 bytes). If the file was
|
||||
# compressed using another blocksize autodetection fails.
|
||||
with open(tarname, "rb") as fobj:
|
||||
data = fobj.read()
|
||||
|
||||
# Compress with blocksize 100kB, the file starts with "BZh11".
|
||||
# Compress with blocksize 100,000 bytes, the file starts with "BZh11".
|
||||
with bz2.BZ2File(tmpname, "wb", compresslevel=1) as fobj:
|
||||
fobj.write(data)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue