Scrapy, a fast high-level web crawling & scraping framework for Python.
a couple of fixes to make tests pass on win32
Pablo Hoffmand8ac4857a500
diff --git a/scrapy/tests/test_utils_response.py b/scrapy/tests/test_utils_response.pyindex 71c14569e..606ed4ee4 100644--- a/scrapy/tests/test_utils_response.py+++ b/scrapy/tests/test_utils_response.py@@ -1,3 +1,4 @@+import osimport unittestimport urlparse@@ -147,7 +148,10 @@ class ResponseUtilsTest(unittest.TestCase):url = "http:///www.example.com/some/page.html"body = "<html> <head> <title>test page</title> </head> <body>test body</body> </html>"def browser_open(burl):- bbody = open(urlparse.urlparse(burl).path).read()+ path = urlparse.urlparse(burl).path+ if not os.path.exists(path):+ path = burl.replace('file://', '')+ bbody = open(path).read()assert '<base href="%s">' % url in bbody, "<base> tag not added"return Trueresponse = HtmlResponse(url, body=body)diff --git a/scrapy/utils/jsonrpc.py b/scrapy/utils/jsonrpc.pyindex 6735e7a03..d9d4008c9 100644--- a/scrapy/utils/jsonrpc.py+++ b/scrapy/utils/jsonrpc.py@@ -67,6 +67,7 @@ def jsonrpc_server_call(target, jsonrpc_request, json_decoder=None):params = req.get('params', [])a, kw = ([], params) if isinstance(params, dict) else (params, {})+ kw = dict([(str(k), v) for k, v in kw.items()]) # convert kw keys to strtry:return jsonrpc_result(id, method(*a, **kw))except Exception, e: