You are trying to apply os.path.normpath
on chain.from_iterable
,
which returns a generator object. So, you have to iterate till the generator exhausts, to get the complete list of filenames which are of type string.
You can use list comprehension like this
simonDuplicates = [os.path.normpath(path) for path in chain.from_iterable(files for files in file_dict.values() if len(files) > 1)]
Or you can use map function like this
simonDuplicates = map(os.path.normpath, chain.from_iterable(files for files in file_dict.values() if len(files) > 1))