fix python gzip method under python 2.6