From 007aa56a1922eea9f364bf3b73e72077046e2c69 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Sun, 28 Jun 2015 15:58:48 -0400 Subject: It's now possible to pickle a BeautifulSoup object no matter which tree builder was used to create it. However, the only tree builder that survives the pickling process is the HTMLParserTreeBuilder ('html.parser'). If you unpickle a BeautifulSoup object created with some other tree builder, soup.builder will be None. [bug=1231545] --- bs4/builder/_htmlparser.py | 1 + 1 file changed, 1 insertion(+) (limited to 'bs4/builder/_htmlparser.py') diff --git a/bs4/builder/_htmlparser.py b/bs4/builder/_htmlparser.py index 25811f1..0101d64 100644 --- a/bs4/builder/_htmlparser.py +++ b/bs4/builder/_htmlparser.py @@ -127,6 +127,7 @@ class BeautifulSoupHTMLParser(HTMLParser): class HTMLParserTreeBuilder(HTMLTreeBuilder): is_xml = False + picklable = True NAME = HTMLPARSER features = [NAME, HTML, STRICT] -- cgit v1.2.3