django 1.8 application migrated to new server rises strange exception

时间:2017-08-05 11:52:57

标签: django typeerror

We had this Django 1.8 application working in the server we setup 6 months ago (Fedora 24 64-Bit). Yesterday we setup a new server with same packages and now we suddenly get this error:

Django Version: 1.8 Exception Type: TypeError Exception Value:

_new_pool() got an unexpected keyword argument 'request_context'

Exception Location: /usr/lib/python2.7/site-packages/urllib3/poolmanager.py in connection_from_pool_key, line 262 Python Executable: /usr/bin/python Python Version: 2.7.11

Seemingly offending code:

# Make a fresh ConnectionPool of the desired type
259             scheme = request_context['scheme']
260             host = request_context['host']
261             port = request_context['port']
262             pool = self._new_pool(scheme, host, port,   request_context=request_context)
263             self.pools[pool_key] = pool

May the Django 1.8 files have changed in repository so this doesn't work anymore? seems very strange to me.

2 个答案:

答案 0 :(得分:0)

What version of urrlib3 are you using? Try upgrading it because request_context was added in this commit 9 months ago.

答案 1 :(得分:0)

d。 Nibon,你是我的英雄。那就是问题所在。似乎这台机器上没有安装python-urllib3软件包。解决!