catch io error in _build_doc lxml because lxml thinks an HTML string is a file :(