Message303662
The attached code is designed to output compressed data to a gzip file. It creates two GzipFile objects, but only one is really used. It seems that it doesn't clean up and close the file properly.
In Py2, the attached code will fail. The output file (debug.txt.gz) will be corrupt. However if the self.unused line is commented out, it works and the file is not corrupted.
In Py3, a sys.exit call at the end is required to see the same behaviour.
As example output, when the sys.exit is include in Py3, the output is below and the file is corrupt.
Compressor.__init__
UnusedClass.write
UnusedClass.write
UnusedClass.write
UnusedClass.write
UnusedClass.write
UnusedClass.write
Compressor.compressToFile
And when the sys.exit is commented out, the console output is below and the file is not corrupt.
Compressor.__init__
UnusedClass.write
UnusedClass.write
UnusedClass.write
UnusedClass.write
UnusedClass.write
UnusedClass.write
Compressor.compressToFile
UnusedClass.write
UnusedClass.write
UnusedClass.write |
|
Date |
User |
Action |
Args |
2017-10-03 23:48:08 | Jake Lever | set | recipients:
+ Jake Lever |
2017-10-03 23:48:08 | Jake Lever | set | messageid: <1507074488.46.0.213398074469.issue31686@psf.upfronthosting.co.za> |
2017-10-03 23:48:08 | Jake Lever | link | issue31686 messages |
2017-10-03 23:48:08 | Jake Lever | create | |
|