Author: sebastian.bank
Description:
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
Version: compat-(1.0)
Severity: normal