Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
headers can not handle non-string values
- Loading branch information
Showing
with
2 additions
and
2 deletions.
-
+2
−2
scrapy/core/downloader/handlers/ftp.py
|
@@ -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): |
|
|