This function is based on the Python sample code @ http://docs.python.org/library/gzip.html. It runs reliably on Ubuntu 10.04 with its default Python 2.6x. On Ubuntu 11.04, however, the code fails @ writelines().
On one 11.04 machine, the failure message reported "'module' object has no attribute 'BufferedIOBase'". Another 11.04 machine reported a different message "No module named numpy".
Does anyone know of any missing Python dependencies or other problems on 11.04 that would cause this?
def _compress(inp,out): import gzip f_out = gzip.open(out,'wb') f_in = open(inp,'rb') f_out.writelines(f_in) f_out.close() f_in.close() os.unlink(inp)