Scrapy, a fast high-level web crawling & scraping framework for Python.
Avoid name clashing in deploy.py, fixes #1143
Julia Medina543d02bc64a7
diff --git a/scrapy/commands/deploy.py b/scrapy/commands/deploy.pyindex b7d989f69..bd8ab3f15 100644--- a/scrapy/commands/deploy.py+++ b/scrapy/commands/deploy.py@@ -194,21 +194,21 @@ def _upload_egg(target, eggpath, project, version):_log('Deploying to project "%s" in %s' % (project, url))return _http_post(req)-def _add_auth_header(request, target):+def _add_auth_header(req, target):if 'username' in target:u, p = target.get('username'), target.get('password', '')- request.add_header('Authorization', basic_auth_header(u, p))+ req.add_header('Authorization', basic_auth_header(u, p))else: # try netrctry:host = urlparse(target['url']).hostnamea = netrc.netrc().authenticators(host)- request.add_header('Authorization', basic_auth_header(a[0], a[2]))+ req.add_header('Authorization', basic_auth_header(a[0], a[2]))except (netrc.NetrcParseError, IOError, TypeError):pass-def _http_post(request):+def _http_post(req):try:- f = request.urlopen(request)+ f = request.urlopen(req)_log("Server response (%s):" % f.code)print(f.read())return True