https://bugzilla.wikimedia.org/show_bug.cgi?id=71497
Bug ID: 71497 Summary: SSLError on requesting data from Wikidata Product: Pywikibot Version: core (2.0) Hardware: All OS: All Status: NEW Severity: normal Priority: Unprioritized Component: network Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: lokal_profil@hotmail.com Web browser: --- Mobile Platform: ---
When trying to get() an item from wikidata I get the following SSL related error:
ERROR: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/pywikibot-2.0b1-py2.7.egg/pywikibot/data/api.py", line 452, in submit headers=headers, body=body) File "/usr/local/lib/python2.7/dist-packages/pywikibot-2.0b1-py2.7.egg/pywikibot/tools.py", line 367, in wrapper return method(*__args, **__kw) File "/usr/local/lib/python2.7/dist-packages/pywikibot-2.0b1-py2.7.egg/pywikibot/comms/http.py", line 258, in request raise request.data SSLError: [Errno 185090050] _ssl.c:344: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib
To reproduce: import pywikibot repo = pywikibot.Site().data_repository() item = pywikibot.ItemPage(repo, 'Q4115189') item.get()
https://bugzilla.wikimedia.org/show_bug.cgi?id=71497
Mpaa mpaa.wiki@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mpaa.wiki@gmail.com
--- Comment #1 from Mpaa mpaa.wiki@gmail.com --- Work for me with:
pywikibot.version.getversion()
u'[ssh] pywikibot-core.git (a5744db, g4204, 2014/10/04, 18:56:45, OUTDATED)'
https://bugzilla.wikimedia.org/show_bug.cgi?id=71497
Fabian CommodoreFabianus@gmx.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |CommodoreFabianus@gmx.de
--- Comment #2 from Fabian CommodoreFabianus@gmx.de --- Does this happen also when calling pywikibot.version.getversion()?
https://bugzilla.wikimedia.org/show_bug.cgi?id=71497
Merlijn van Deen valhallasw@arctus.nl changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |valhallasw@arctus.nl
--- Comment #3 from Merlijn van Deen valhallasw@arctus.nl --- Apparently this is what you get if your certificates file is missing. What version of httplib2 do you have installed, and was it installed by a package manager or with pip?
In the latter case, please pip install --upgrade httplib2; in the former case, a bug report for your distribution might be in order.
https://bugzilla.wikimedia.org/show_bug.cgi?id=71497
--- Comment #4 from Lokal_Profil lokal_profil@hotmail.com --- @Fabian: SSL issue doesn't happen when I call pywikibot.version.getversion()
@Merlijn: Running "pip install --upgrade httplib2" didn't help (and on searching I find cacert.pem in the requests directory).
Completely reinstalled pywikibot (to try and remove any issues related to the egg installer but still the same issue.
u'[ssh] pywikibot-core.git (df93880, g4208, 2014/10/05, 23:53:47, n/a)'
Reading a bit at https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1306991 it seems as though requests is broken for Ubuntu 14.04.
https://bugzilla.wikimedia.org/show_bug.cgi?id=71497
--- Comment #5 from Lokal_Profil lokal_profil@hotmail.com --- @Merlijn: running httplib2 version 0.9
https://bugzilla.wikimedia.org/show_bug.cgi?id=71497
--- Comment #6 from Merlijn van Deen valhallasw@arctus.nl --- Note that we use *httplib2*, not requests! Please try the following
$ python Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import httplib2 httplib2.CA_CERTS
This gives me '/etc/ssl/certs/ca-certificates.crt' for my Ubuntu 14.04-packaged httplib2, and '/path/to/venv/lib/python2.6/site-packages/httplib2-0.8_pywikibot1-py2.6.egg/httplib2/cacerts.txt' for a virtualenv.
What do you get, and does that file exist?
https://bugzilla.wikimedia.org/show_bug.cgi?id=71497
--- Comment #7 from Lokal_Profil lokal_profil@hotmail.com --- Sorry about that. Me getting confused between httplib and requests.
httplib2.CA_CERTS gives me /usr/local/lib/python2.7/dist-packages/httplib2-0.9-py2.7.egg/httplib2/cacerts.txt
---
I finally got things to work by deleting the httplib2 directory in the externals folder of pywikibot.
https://bugzilla.wikimedia.org/show_bug.cgi?id=71497
Merlijn van Deen valhallasw@arctus.nl changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |WORKSFORME
https://bugzilla.wikimedia.org/show_bug.cgi?id=71497
--- Comment #8 from Lokal_Profil lokal_profil@hotmail.com --- Is the httplib2 in core/externals necessary?
https://bugzilla.wikimedia.org/show_bug.cgi?id=71497
--- Comment #9 from Merlijn van Deen valhallasw@arctus.nl --- Yes. It's used by people using pywikibot-as-a-portable-package via pwb.py. I'm not sure why your system decided to a) use that directory (instead of using the system-installed one) or b) why it couldn't find it's cacerts file (which is included in the externals/httplib2 directory).
pywikipedia-bugs@lists.wikimedia.org