'Read the doctree for a file from the pickle and return it.'

def get_doctree(self, docname):

    doctree_filename = self.doc2path(docname, self.doctreedir, '.doctree')
    with open(doctree_filename, 'rb') as f:
        doctree = pickle.load(f)
    doctree.settings.env = self
    doctree.reporter = Reporter(self.doc2path(docname), 2, 5, stream=WarningStream())
    return doctree
