Skip to content

Commit

Permalink
headers can not handle non-string values
Browse files Browse the repository at this point in the history
  • Loading branch information
dangra committed Aug 8, 2014
1 parent a274a7f commit 94a5c65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scrapy/core/downloader/handlers/ftp.py
Expand Up @@ -83,13 +83,13 @@ def gotClient(self, client, request, filepath):
callbackArgs=(request, protocol),
errback=self._failed,
errbackArgs=(request,))

def _build_response(self, result, request, protocol):
self.result = result
respcls = responsetypes.from_args(url=request.url)
protocol.close()
body = protocol.filename or protocol.body.read()
headers = {"local filename": protocol.filename or '', "size": protocol.size}
headers = {"local filename": protocol.filename or '', "size": str(protocol.size)}
return respcls(url=request.url, status=200, body=body, headers=headers)

def _failed(self, result, request):
Expand Down

0 comments on commit 94a5c65

Please sign in to comment.