Skip to content

Instantly share code, notes, and snippets.

@alkamid

alkamid/error.py Secret

Created August 16, 2015 06:30
Show Gist options
  • Save alkamid/2a2cb399a193d7fa6254 to your computer and use it in GitHub Desktop.
Save alkamid/2a2cb399a193d7fa6254 to your computer and use it in GitHub Desktop.
pywikibot ssl
ERROR: Traceback (most recent call last):
File "/home/.../wikt/pywikibot/core/pywikibot/data/api.py", line 1556, in submit
body=body, headers=headers)
File "/home/.../wikt/pywikibot/core/pywikibot/tools/__init__.py", line 1105, in wrapper
return obj(*__args, **__kw)
File "/home/.../wikt/pywikibot/core/pywikibot/comms/http.py", line 279, in request
r = fetch(baseuri, method, body, headers, **kwargs)
File "/home/.../wikt/pywikibot/core/pywikibot/comms/http.py", line 381, in fetch
error_handling_callback(request)
File "/home/.../wikt/pywikibot/core/pywikibot/comms/http.py", line 293, in error_handling_callback
raise FatalServerError(str(request.data))
pywikibot.exceptions.FatalServerError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)
Traceback (most recent call last):
File "testref.py", line 11, in <module>
test()
File "testref.py", line 9, in test
print(page.get())
File "/home/.../wikt/pywikibot/core/pywikibot/tools/__init__.py", line 1105, in wrapper
return obj(*__args, **__kw)
File "/home/.../wikt/pywikibot/core/pywikibot/page.py", line 357, in get
self._getInternals(sysop)
File "/home/.../wikt/pywikibot/core/pywikibot/page.py", line 387, in _getInternals
self.site.loadrevisions(self, getText=True, sysop=sysop)
File "/home/.../wikt/pywikibot/core/pywikibot/site.py", line 3305, in loadrevisions
if self.has_extension('ProofreadPage'):
File "/home/.../wikt/pywikibot/core/pywikibot/site.py", line 1114, in callee
return fn(self, *args, **kwargs)
File "/home/.../wikt/pywikibot/core/pywikibot/site.py", line 2222, in has_extension
extensions = self.siteinfo['extensions']
File "/home/.../wikt/pywikibot/core/pywikibot/site.py", line 1306, in __getitem__
return self.get(key, False) # caches and doesn't force it
File "/home/.../wikt/pywikibot/core/pywikibot/site.py", line 1350, in get
preloaded = self._get_siteinfo(key, expiry)[key]
File "/home/.../wikt/pywikibot/core/pywikibot/site.py", line 1221, in _get_siteinfo
data = request.submit()
File "/home/.../wikt/pywikibot/core/pywikibot/data/api.py", line 1889, in submit
self._data = super(CachedRequest, self).submit()
File "/home/.../wikt/pywikibot/core/pywikibot/data/api.py", line 1556, in submit
body=body, headers=headers)
File "/home/.../wikt/pywikibot/core/pywikibot/tools/__init__.py", line 1105, in wrapper
return obj(*__args, **__kw)
File "/home/.../wikt/pywikibot/core/pywikibot/comms/http.py", line 279, in request
r = fetch(baseuri, method, body, headers, **kwargs)
File "/home/.../wikt/pywikibot/core/pywikibot/comms/http.py", line 381, in fetch
error_handling_callback(request)
File "/home/.../wikt/pywikibot/core/pywikibot/comms/http.py", line 293, in error_handling_callback
raise FatalServerError(str(request.data))
pywikibot.exceptions.FatalServerError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)
<class 'pywikibot.exceptions.FatalServerError'>
#!/usr/bin/python
# -*- coding: utf-8 -*-
import pywikibot
def test():
site = pywikibot.getSite('pl', 'wiktionary')
page = pywikibot.Page(site, 'cool')
print(page.get())
test()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment