Pass proxy URI to ProxyAgent as bytes

This commit is contained in:
Paul Tremberth 2017-06-01 11:58:17 +02:00
parent c8dc158697
commit e162c1ff40
1 changed files with 1 additions and 1 deletions

View File

@ -283,7 +283,7 @@ class ScrapyAgent(object):
contextFactory=self._contextFactory, connectTimeout=timeout,
bindAddress=bindaddress, pool=self._pool)
else:
return self._ProxyAgent(reactor, proxyURI=proxy,
return self._ProxyAgent(reactor, proxyURI=to_bytes(proxy, encoding='ascii'),
connectTimeout=timeout, bindAddress=bindaddress, pool=self._pool)
return self._Agent(reactor, contextFactory=self._contextFactory,