Merge PDF files

print(unique_new_names)

[‘24234’, ‘01441’, ‘09468’]

mergers = [PdfFileMerger() for i in range(len(unique_new_names))]
for unique_name,i in zip(unique_new_names,range(len(unique_new_names))):

for file, PDF_name in zip(all_files,all_PDF_names):
    
    if PDF_name.startswith(unique_name):
        mergers[i].append(open(file, 'rb'))

OSError: [Errno 22] Invalid argument

I am trying to merge PDF files with the same name, can anyone help?
How do create and use class objects dynamically?