'Merge files with copy.copyfileobj() will not hit the
max argument limitation of cat. gz and bz2 files are also working.'

def merge(split_files, output_file):

    if (not split_files):
        raise ValueError(('Asked    to    merge    zero    files    as    %s' % output_file))
    elif (len(split_files) == 1):
        shutil.copyfileobj(open(split_files[0], 'rb'), open(output_file, 'wb'))
    else:
        fdst = open(output_file, 'wb')
        for fsrc in split_files:
            shutil.copyfileobj(open(fsrc, 'rb'), fdst)
        fdst.close()
