Last modified: 2014-09-02 11:36:17 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 T70725, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 68725 - import of compat SVN working copy requires internet connection
import of compat SVN working copy requires internet connection
Status: NEW
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
compat-(1.0)
All All
: Unprioritized normal
: ---
Assigned To: John Mark Vandenberg
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-28 10:39 UTC by xflr6
Modified: 2014-09-02 11:36 UTC (History)
1 user (show)

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


Attachments

Description xflr6 2014-07-28 10:39:17 UTC
wikipedia.py retrieves version.getversiondict()["rev"] to set the User-agent when imported.

https://gerrit.wikimedia.org/r/#/c/86374/ changed version.getversion_svn() to unconditionally ask github for the git-hash. However, the hash itself isn't actually used in wikipedia.py (see also https://bugzilla.wikimedia.org/show_bug.cgi?id=54686).

This undermines e.g. to unpickle previously saved page objects when access to github.com does not work. It also seems an unpleasant thing, to make such a roundtrip every time the library is imported, right?

Maybe getversiondict() and the code it dispatches to can get an opt-out (not to retrieve information by speaking to the network) to be used in the User-agent case.


>>> import wikipedia

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import wikipedia
  File "wikipedia.py", line 6023, in <module>
    versionrev=(version.getversiondict()["rev"])
  File "pywikibot\version.py", line 58, in getversiondict
    (tag, rev, date, hsh) = getversion_svn(_program_dir)
  File "pywikibot\version.py", line 151, in getversion_svn
    {'Label': rev, 'User-Agent': 'SVN/1.7.5-pywikibot1'})
  File "C:\Program Files\Python27\lib\httplib.py", line 995, in request
    self._send_request(method, url, body, headers)
  File "C:\Program Files\Python27\lib\httplib.py", line 1029, in _send_request
    self.endheaders(body)
  File "C:\Program Files\Python27\lib\httplib.py", line 991, in endheaders
    self._send_output(message_body)
  File "C:\Program Files\Python27\lib\httplib.py", line 844, in _send_output
    self.send(msg)
  File "C:\Program Files\Python27\lib\httplib.py", line 806, in send
    self.connect()
  File "C:\Program Files\Python27\lib\httplib.py", line 1194, in connect
    self.timeout, self.source_address)
  File "C:\Program Files\Python27\lib\socket.py", line 553, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
gaierror: [Errno 11004] getaddrinfo failed


Pywikibot: pywikibot-compat (8317312, s11008, 2014/07/27, 11:54:19, ok)
Release version: 1.0b1
Python: 2.7.8 (default, Jun 30 2014, 16:08:48) [MSC v.1500 64 bit (AMD64)]
config-settings:
use_api = True
use_api_login = True
unicode test: ok

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


Navigation
Links