Message127006
Interesting! If you are motivated, a further approach would be to expose the compressor and decompressor objects from the C extension, and write the file object in Python (as in Lib/gzip.py).
> One thing I was unsure of is how to handle exceptions that occur in
> BZ2File_dealloc(). Does the error status need to be cleared before it
> returns?
Yes, it should. Actually, it would be better to write out the exception using PyErr_WriteUnraisable().
> On a related note, the 'buffering' argument to __init__() is ignored,
> and I was wondering whether this should be documented explicitly?
Yes, it should probably be deprecated if it's not useful anymore.
By the way, the current patch produces reference leaks:
$ ./python -m test -R 3:2 test_bz2
[1/1] test_bz2
beginning 5 repetitions
12345
.....
test_bz2 leaked [44, 44] references, sum=88 |
|
Date |
User |
Action |
Args |
2011-01-25 13:07:36 | pitrou | set | recipients:
+ pitrou, rhettinger, niemeyer, wrobell, nadeem.vawda, eric.araujo, MizardX, antlong, xuanji |
2011-01-25 13:07:36 | pitrou | set | messageid: <1295960856.71.0.0641141621157.issue5863@psf.upfronthosting.co.za> |
2011-01-25 13:07:35 | pitrou | link | issue5863 messages |
2011-01-25 13:07:35 | pitrou | create | |
|