How to troubleshoot an “AttributeError: __exit__” in multiproccesing in Python?
The problem is in this line: You are using the with statement. It requires an object with __enter__ and __exit__ methods. But pattern.findall returns a list, with tries to store the __exit__ method, but it can’t find it, and raises an error. Just use instead.