I've fixed this problem in two ways. As of revision 520, copies of tags propagate information originally obtained from the TreeBuilder, so .preserve_whitespace_tags won't be None. As of revision 518, _should_pretty_print() will function even if Tag.preserve_whitespace_tags _is_ None.
I don't see a good way to work around this without updating the code, so in revision 521 I made it possible to pass replacements for Tag and NavigableString into the BeautifulSoup constructor. That will make future workarounds easier.
I've fixed this problem in two ways. As of revision 520, copies of tags propagate information originally obtained from the TreeBuilder, so .preserve_ whitespace_ tags won't be None. As of revision 518, _should_ pretty_ print() will function even if Tag.preserve_ whitespace_ tags _is_ None.
I don't see a good way to work around this without updating the code, so in revision 521 I made it possible to pass replacements for Tag and NavigableString into the BeautifulSoup constructor. That will make future workarounds easier.