Hi, I just opened a bug report, not sure if they're looked at so decided to post it here as well
https://bugs.launchpad.net/beautifulsoup/+bug/1934003Basically, the following code raises an exception when builder is None - which sometimes happens to me (I think when I'm pickling an unrelated object, I'm not sure)
def __getstate__(self):
# Frequently a tree builder can't be pickled.
d = dict(self.__dict__)
if 'builder' in d and not self.builder.picklable:
d['builder'] = None
return d
I think it should be
if d.get('builder') is not None and not self.builder.picklable