Scrapy, a fast high-level web crawling & scraping framework for Python.
Small bugfix in selectors constructor regarding strings and unicodes
elpolilla66852b829135
diff --git a/scrapy/trunk/scrapy/xpath/selector.py b/scrapy/trunk/scrapy/xpath/selector.pyindex f614f9f5f..da939bb91 100644--- a/scrapy/trunk/scrapy/xpath/selector.py+++ b/scrapy/trunk/scrapy/xpath/selector.py@@ -3,7 +3,7 @@ import libxml2from scrapy.http import Responsefrom scrapy.xpath.extension import Libxml2Documentfrom scrapy.xpath.constructors import xmlDoc_from_html, xmlDoc_from_xml-from scrapy.utils.python import flatten+from scrapy.utils.python import flatten, unicode_to_strfrom scrapy.utils.misc import extract_regexclass XPathSelector(object):@@ -28,7 +28,7 @@ class XPathSelector(object):self.doc = Libxml2Document(response, constructor=constructor)self.xmlNode = self.doc.xmlDocelif text:- response = Response(domain=None, url=None, body=str(text))+ response = Response(domain=None, url=None, body=unicode_to_str(text))self.doc = Libxml2Document(response, constructor=constructor)self.xmlNode = self.doc.xmlDocself.expr = expr