Skip to content

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

Fixed bug with deploy command if ~/.netrc doesn't exist. Closes #286

Pablo Hoffmanb3c96c698def
diff --git a/scrapy/commands/deploy.py b/scrapy/commands/deploy.py
index a8c546de1..84b545420 100644
--- a/scrapy/commands/deploy.py
+++ b/scrapy/commands/deploy.py
@@ -171,7 +171,7 @@ def _add_auth_header(request, target):
host = urlparse(target['url']).hostname
a = netrc.netrc().authenticators(host)
request.add_header('Authorization', basic_auth_header(a[0], a[2]))
- except (netrc.NetrcParseError, TypeError):
+ except (netrc.NetrcParseError, IOError, TypeError):
pass
def _http_post(request):