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@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@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
Hello Robert,
I'm pretty sure that this is a family configuration issue.
Can you please post your mustang_family.py to the list? Be careful not to include any sensitive information if you have any ;)
Regards,
Hi Nicolas,
Thanks for getting back to me.
I have attached the family file and the user-config file.
This is a development server inside my firewall. It is not accessible from the Internet.
Media wiki is installed and running fine. I have a user named 'Wikibot' configured and in the BOT group. I noticed that the user-config.py has several references to Wikiuser. Should these be Wikibot? user-config.py also has references to the DB name, user and password. These are not filled in correctly. Is it required that they be setup to match the MySQL DB for MediaWiki?
---Robert
On Fri, Sep 25, 2009 at 11:09 AM, Nicolas Dumazet nicdumz@gmail.com wrote:
Hello Robert,
I'm pretty sure that this is a family configuration issue.
Can you please post your mustang_family.py to the list? Be careful not to include any sensitive information if you have any ;)
Regards,
Nicolas Dumazet — NicDumZ
2009/9/25 Robert Wright marvin.sccorp@gmail.com:
Media wiki is installed and running fine. I have a user named 'Wikibot' configured and in the BOT group. I noticed that the user-config.py has several references to Wikiuser. Should these be Wikibot?
Yes. But that's not causing your socket error.
user-config.py also has references to the DB name, user and password. These are not filled in correctly. Is it required that they be setup to match the MySQL DB for MediaWiki?
It's not required, unless you need to perform direct DB operations. Anyway, it is not causing the socket error.
I looked at your family file, the error is here: self.langs = { # REQUIRED 'en': 'mustang/wiki/', # Include one line for each wiki in family } First, we don't need to append the /wiki/ relative path, but only the path to the root of the wiki. But again, that's probably not causing the error.
What happens with self.langs = { 'en': 'mustang', } ? (localhost should behave the same since mustang appears to be your host name...)
Can you paste here the output of $ python login.py -v -v ?
Double-check that the urls that pywikipedia will try to access are accessible through tools such as curl/wget.