pepper
pepper copied to clipboard
TypeError: urlopen() got an unexpected keyword argument 'context'
Hi there I'm currently running in the following error:
err@2dbc493bfb79:~$ pepper '*' test.ping --ignore-ssl-errors -H -vvv
urlopen() got an unexpected keyword argument 'context'
Uncaught Pepper error (increase verbosity for the full traceback).
Uncaught traceback:
Traceback (most recent call last):
File "/app/venv/bin/pepper", line 26, in <module>
exit_code, results = cli.run()
File "/app/venv/lib/python3.4/site-packages/pepper/cli.py", line 373, in run
auth = api.login(*list(creds))
File "/app/venv/lib/python3.4/site-packages/pepper/libpepper.py", line 330, in login
'eauth': eauth}).get('return', [{}])[0]
File "/app/venv/lib/python3.4/site-packages/pepper/libpepper.py", line 134, in req
f = urlopen(req, context=con)
TypeError: urlopen() got an unexpected keyword argument 'context'
DEBUG 2016-10-27 22:38:52,101 pepper: Uncaught traceback:
Traceback (most recent call last):
File "/app/venv/bin/pepper", line 26, in <module>
exit_code, results = cli.run()
File "/app/venv/lib/python3.4/site-packages/pepper/cli.py", line 373, in run
auth = api.login(*list(creds))
File "/app/venv/lib/python3.4/site-packages/pepper/libpepper.py", line 330, in login
'eauth': eauth}).get('return', [{}])[0]
File "/app/venv/lib/python3.4/site-packages/pepper/libpepper.py", line 134, in req
f = urlopen(req, context=con)
TypeError: urlopen() got an unexpected keyword argument 'context'
I installed pepper directly over the Github repo:
err@2dbc493bfb79:~$ python --version
Python 3.4.2
err@2dbc493bfb79:~$ pip install git+https://github.com/saltstack/pepper.git
Collecting git+https://github.com/saltstack/pepper.git
Cloning https://github.com/saltstack/pepper.git to /tmp/pip-r9dfl769-build
Installing collected packages: salt-pepper
Running setup.py install for salt-pepper ... done
Successfully installed salt-pepper-0.4.1.dev22
Do you perhaps have any idea how to fix this issue?
Thanks & regards,
Philip
Any updates on this? Do you need further information? If so, what exactly?
Thanks, Philip
Sorry for the slow reply!
Hm. It seems the context arg was removed in Python 3.0-3.3 but reintroduced in 3.4. Looks like we'll need a method of not verifying certs that works across 2, 3.0-3.3, and also 3.4+. 😵
Different versions of urllib support / don't support 'context'. You could throw a try statement on the urlopen()
, and remove context from kwargs on the except.
Stale. Not interested anymore.