To use the construct with, the object used internally must have __enter__and methods __exit__. The error says that the class Pool(or instance) does not have this data, so you cannot use it in an instruction with. Try this (just remove the with statement):
import glob, multiprocessing, shutil
filenames = [gz for gz in glob.glob('.' + '*.gz')]
def uncompress(path):
with gzip.open(path, 'rb') as src, open(path.rstrip('.gz'), 'wb') as dest:
shutil.copyfileobj(src, dest)
for _ in multiprocessing.Pool().imap_unordered(uncompress, filenames, chunksize=1):
pass
EDIT
@dhke, ( ) gz , ( ) ().