Message212796
# Bug demo
TEXT_LINES = [
b'cutecat\n',
b'promiscuousbonobo\n',
]
TEXT = b''.join(TEXT_LINES)
import bz2
filename = '/tmp/demo.bz2'
with open(filename, 'wb') as f:
f.write(bz2.compress(TEXT))
with bz2.BZ2File(filename) as bz2f:
pdata = bz2f.peek(n=7)
print(pdata)
It outputs b'cutecat\npromiscuousbonobo\n', not b'cutecat'.
Here is the patch to fix the bug. |
|
Date |
User |
Action |
Args |
2014-03-06 08:56:39 | vajrasky | set | recipients:
+ vajrasky, nadeem.vawda |
2014-03-06 08:56:39 | vajrasky | set | messageid: <1394096199.33.0.0844376758582.issue20856@psf.upfronthosting.co.za> |
2014-03-06 08:56:38 | vajrasky | link | issue20856 messages |
2014-03-06 08:56:38 | vajrasky | create | |
|