Last modified: 2013-10-31 07:46:32 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T58386, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56386 - setup.py should require httplib2
setup.py should require httplib2
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
core-(2.0)
All All
: Unprioritized normal
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-30 20:13 UTC by Cristian Consonni
Modified: 2013-10-31 07:46 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Test script (247 bytes, text/x-python)
2013-10-30 20:13 UTC, Cristian Consonni
Details
install log (61.31 KB, text/plain)
2013-10-30 20:24 UTC, Merlijn van Deen (test)
Details

Description Cristian Consonni 2013-10-30 20:13:38 UTC
Created attachment 13632 [details]
Test script

Running <code>python setup.py install</code> while in virtualenv does not install automatically the httplib2 dependency.

<code>
(pywikibot)cristian@cristian-F5N:~$ python test.py "Alessandro_Manzoni"
Traceback (most recent call last):
  File "test.py", line 4, in <module>
    import pywikibot
  File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/__init__.py", line 313, in <module>
    from page import Page, ImagePage, Category, Link, User, ItemPage, PropertyPage, Claim
  File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/page.py", line 16, in <module>
    import pywikibot.site
  File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/site.py", line 33, in <module>
    from pywikibot.data import api
  File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/data/api.py", line 13, in <module>
    from pywikibot.comms import http
  File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/comms/http.py", line 30, in <module>
    from httplib2 import SSLHandshakeError
ImportError: No module named httplib2
</code>

<code>test.py</code> is attached.

I am using Python 2.7.3 under <code>virtualenv</code> version 1.9.1 on Ubuntu 12.10.

Furthermore installing the dependency with <code>pip install httplib2</code> cause the following bug.

<code>
(pywikibot)cristian@cristian-F5N:~$ python test.py "Alessandro_Manzoni"
ERROR: Traceback (most recent call last):
  File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/data/api.py", line 284, in submit
    body=paramstring)
  File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/comms/http.py", line 123, in request
    raise FatalServerError(str(request.data))
FatalServerError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

Traceback (most recent call last):
  File "test.py", line 12, in <module>
    item = pywikibot.ItemPage.fromPage(wikipage)
  File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/page.py", line 2527, in fromPage
    repo = page.site.data_repository()
  File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/page.py", line 98, in site
    return self._link.site
  File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/page.py", line 3224, in site
    self.parse()
  File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/page.py", line 3207, in parse
    if self._site.case() == 'first-letter':
  File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/site.py", line 1173, in case
    return self.siteinfo['case']
  File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/site.py", line 1167, in siteinfo
    self._getsiteinfo()
  File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/site.py", line 1100, in _getsiteinfo
    sidata = sirequest.submit()
  File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/data/api.py", line 462, in submit
    self._data = super(CachedRequest, self).submit()
  File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/data/api.py", line 284, in submit
    body=paramstring)
  File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/comms/http.py", line 123, in request
    raise FatalServerError(str(request.data))
pywikibot.exceptions.FatalServerError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
</code>

Steps to reproduce:
* download core.tar.gz and unzip
* create virtualenv
* run <code>python setup.py install</code> from <code>core</code>
* run <code>python test.py "Alessandro_Manzoni"</code>
Comment 1 Cristian Consonni 2013-10-30 20:16:26 UTC
Of course installing the right dependency:

pip install https://git.wikimedia.org/zip/?r=pywikibot/externals/httplib2.git&format=gz#egg=httplib2-0.8-pywikibot1

Solves the issue. This should be automatic.
Comment 2 Merlijn van Deen (test) 2013-10-30 20:18:11 UTC
I'm confused by this, as setup.py /does/ require httplib2:



    install_requires=[
        'httplib2>=0.6.0'
    ],
    dependency_links=[
        'https://git.wikimedia.org/zip/?r=pywikibot/externals/httplib2.git&format=gz#egg=httplib2-0.8-pywikibot1'
    ],



Which core.tar.gz did you download? http://tools.wmflabs.org/pywikibot/core.tar.gz , or some other version?
Comment 3 Merlijn van Deen (test) 2013-10-30 20:24:35 UTC
Created attachment 13633 [details]
install log

OK, I can reproduce it:

wget http://tools.wmflabs.org/pywikibot/core.tar.gz
tar -xvzf core.tar.gz
cd core
virtualenv .
source bin/activate
python setup.py install | tee installog

results in the attached installog, and not in a working httplib2...
Comment 4 Gerrit Notification Bot 2013-10-30 20:33:44 UTC
Change 92765 had a related patch set uploaded by Merlijn van Deen:
Fix dependency installation during setup.py install

https://gerrit.wikimedia.org/r/92765
Comment 5 Gerrit Notification Bot 2013-10-31 06:39:43 UTC
Change 92765 merged by jenkins-bot:
Fix dependency installation during setup.py install

https://gerrit.wikimedia.org/r/92765

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links