diff --git a/scrapy/tests/test_utils_response.py b/scrapy/tests/test_utils_response.py
index 71c14569e..606ed4ee4 100644
--- a/scrapy/tests/test_utils_response.py
+++ b/scrapy/tests/test_utils_response.py
@@ -1,3 +1,4 @@
+import os
import unittest
import urlparse
@@ -147,7 +148,10 @@ class ResponseUtilsTest(unittest.TestCase):
url = "http:///www.example.com/some/page.html"
body = "
test page test body "
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 '' % url in bbody, " tag not added"
return True
response = HtmlResponse(url, body=body)
diff --git a/scrapy/utils/jsonrpc.py b/scrapy/utils/jsonrpc.py
index 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 str
try:
return jsonrpc_result(id, method(*a, **kw))
except Exception, e: