[Pywikipedia-l] socket.gaierror: [Errno -2] Name or service not known

Robert Wright marvin.sccorp at gmail.com
Fri Sep 25 16:50:36 UTC 2009


I am installing pywikipedia. I have gotten to  the point where I can run
python login.py and get prompted for a password. Then I get this:

[root at mustang pywikipedia]# !python
python login.py
Password for user wikibot on mustang:en:
Logging in to mustang:en as wikibot
Traceback (most recent call last):
  File "login.py", line 376, in <module>
    main()
  File "login.py", line 372, in main
    loginMan.login()
  File "login.py", line 261, in login
    cookiedata = self.getCookie(api)
  File "login.py", line 178, in getCookie
    response, data = self.site.postData(address,
self.site.urlEncode(predata))
  File "/home/rwright/pywikipedia/wikipedia.py", line 4945, in postData
    conn.endheaders()
  File "/usr/lib/python2.6/httplib.py", line 868, in endheaders
    self._send_output()
  File "/usr/lib/python2.6/httplib.py", line 740, in _send_output
    self.send(msg)
  File "/usr/lib/python2.6/httplib.py", line 699, in send
    self.connect()
  File "/usr/lib/python2.6/httplib.py", line 683, in connect
    self.timeout)
  File "/usr/lib/python2.6/socket.py", line 498, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno -2] Name or service not known
[root at mustang pywikipedia]#


I tried the only solution on the archive I could find

Hello Mary,

the self.langs should contain the hostname 'localhost'. The path for the
wiki should be given in scriptpath. In your case, try something like

  self.langs = {'en': 'localhost'}

  def scriptpath(self, code):
    return '/default'



Hopefully that should work!

Best reagards,
Merlijn

This did not work.

Any help would be much appreciated.

---Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wikimedia.org/pipermail/pywikipedia-l/attachments/20090925/e0149b14/attachment.htm 


More information about the Pywikipedia-l mailing list