Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

fixed bug

samus_d0e5245fba99
diff --git a/scrapy/trunk/scrapy/http/response.py b/scrapy/trunk/scrapy/http/response.py
index b91d64186..aab874669 100644
--- a/scrapy/trunk/scrapy/http/response.py
+++ b/scrapy/trunk/scrapy/http/response.py
@@ -80,8 +80,11 @@ class Response(object) :
kw.get('url', self.url),
original_url=kw.get('original_url', self.original_url),
headers=kw.get('headers', sameheaders()),
- status=kw.get('status', self.status))
- newresp.body = kw.get('body', samebody())
+ status=kw.get('status', self.status),
+ body=kw.get('body'))
+ # Response.__init__ forbids the use of ResponseBody instances
+ if 'body' not in kw:
+ newresp.body = samebody()
return newresp
def to_string(self):