Hi,
Can anyone recommend some good trouble shooting/debugging websites for setting up Pywikipedia.
I have followed the installation instructions on http://meta.wikimedia.org/wiki/Using_the_python_wikipediabot but when I try running the "login.py" it fails, output attached below. I guess I have missed something but I can't see what it is and I am not sure how to debug it. Searching this archive for "installation" or "login" has not helped.
I have set up a new testwiki on a local machine, the user name for my bot is correctly register and work for the actual wiki.
I have included my user-config.py and testwiki_family.py files, in case it is an obvious silly mistake.
Thanks for your help
Joe
# python version.py #################################################### Checked for running processes. 1 processes currently running, including the current process. Pywikipedia (r5199 (wikipedia.py), Apr 08 2008, 19:34:47) Python 2.4.4c1 (#2, Mar 7 2008, 02:53:24) [GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] #################################################################
# Error message ###################################################### python login.py Checked for running processes. 1 processes currently running, including the current process. Password for user RDFbot on testwiki:en: Logging in to testwiki:en as RDFbot Traceback (most recent call last): File "login.py", line 277, in ? main() File "login.py", line 273, in main loginMan.login() File "login.py", line 219, in login cookiedata = self.getCookie() File "login.py", line 131, in getCookie response, data = self.site.postForm(address, predata, useCookie=False) File "/home/joe/software/wiki/pywikipedia_svn/wikipedia.py", line 4008, in postForm raise ServerError(e) wikipedia.ServerError: (-2, 'Name or service not known') ##############################################################
# user-config.py ##################################################### mylang = 'en' family = 'testwiki' usernames['testwiki']['en'] = 'RDFbot' console_encoding = 'utf-8' #################################################################
# testwiki_family.py #################################################### # -*- coding: utf-8 -*- import family
# The testwiki.
class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'testwiki'
self.langs = { 'en': '"server_path"/testwiki', }
self.namespaces[4] = { '_default': u'TestWiki', }
self.namespaces[5] = { '_default': u'TestWiki talk', }
self.biglangs = ['en']
def path(self, code): return '/%s/index.php' % code #The language code is included in the path
def version(self, code): return "1.12"
##########################################################
In the testwiki_family.py:
self.langs = { 'en': '"server_path"/testwiki', }
that should be 'en': 'localhost/wiki', or whereever your wiki is located.
Good luck.
--valhallasw
On Wed, April 9, 2008 2:55 pm, Joseph Padfield wrote:
Hi,
Can anyone recommend some good trouble shooting/debugging websites for setting up Pywikipedia.
I have followed the installation instructions on http://meta.wikimedia.org/wiki/Using_the_python_wikipediabot but when I try running the "login.py" it fails, output attached below. I guess I have missed something but I can't see what it is and I am not sure how to debug it. Searching this archive for "installation" or "login" has not helped.
I have set up a new testwiki on a local machine, the user name for my bot is correctly register and work for the actual wiki.
I have included my user-config.py and testwiki_family.py files, in case it is an obvious silly mistake.
Thanks for your help
Joe
# python version.py #################################################### Checked for running processes. 1 processes currently running, including the current process. Pywikipedia (r5199 (wikipedia.py), Apr 08 2008, 19:34:47) Python 2.4.4c1 (#2, Mar 7 2008, 02:53:24) [GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] #################################################################
# Error message ###################################################### python login.py Checked for running processes. 1 processes currently running, including the current process. Password for user RDFbot on testwiki:en: Logging in to testwiki:en as RDFbot Traceback (most recent call last): File "login.py", line 277, in ? main() File "login.py", line 273, in main loginMan.login() File "login.py", line 219, in login cookiedata = self.getCookie() File "login.py", line 131, in getCookie response, data = self.site.postForm(address, predata, useCookie=False) File "/home/joe/software/wiki/pywikipedia_svn/wikipedia.py", line 4008, in postForm raise ServerError(e) wikipedia.ServerError: (-2, 'Name or service not known') ##############################################################
# user-config.py ##################################################### mylang = 'en' family = 'testwiki' usernames['testwiki']['en'] = 'RDFbot' console_encoding = 'utf-8' #################################################################
# testwiki_family.py #################################################### # -*- coding: utf-8 -*- import family
# The testwiki.
class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'testwiki'
self.langs = { 'en': '"server_path"/testwiki', } self.namespaces[4] = { '_default': u'TestWiki', } self.namespaces[5] = { '_default': u'TestWiki talk', } self.biglangs = ['en'] def path(self, code): return '/%s/index.php' % code #The language code is included in
the path
def version(self, code): return "1.12"
##########################################################
-- Joseph Padfield, joseph.padfield@ng-london.org.uk, Tel: +44 (0)20 7747 2553 Fax: +44 (0)20 7839 3897 Conservation Scientist, Scientific Department, The National Gallery, Trafalgar Square, London, WC2N 5DN
Pompeo Batoni (1708-1787) Until 18 May 2008 Book Now http://www.nationalgallery.org.uk/exhibitions/batoni/tickets.htm Open daily 10am to 6pm, Wednesdays until 9pm
Sign up for the latest news, offers and exclusive competitions from the National Gallery by clicking on this link http://www.nationalgallery.org.uk/what/news/subscribe.htm
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Hi,
Thanks for the reply,
I do actually have correct path in there, edited it out in the post.
Basically I had 'servername.ng-london.org.uk/~joe/testwiki'
As you mentioned the path I actually tried moving to the root rather than my own area:
'servername.ng-london.org.uk/testwiki'
and I tried
'localhost/testwiki'
But still no joy.
Thanks
Joe
Merlijn van Deen wrote:
In the testwiki_family.py:
self.langs = { 'en': '"server_path"/testwiki', }
that should be 'en': 'localhost/wiki', or whereever your wiki is located.
Good luck.
--valhallasw
On Wed, April 9, 2008 2:55 pm, Joseph Padfield wrote:
Hi,
Can anyone recommend some good trouble shooting/debugging websites for setting up Pywikipedia.
I have followed the installation instructions on http://meta.wikimedia.org/wiki/Using_the_python_wikipediabot but when I try running the "login.py" it fails, output attached below. I guess I have missed something but I can't see what it is and I am not sure how to debug it. Searching this archive for "installation" or "login" has not helped.
I have set up a new testwiki on a local machine, the user name for my bot is correctly register and work for the actual wiki.
I have included my user-config.py and testwiki_family.py files, in case it is an obvious silly mistake.
Thanks for your help
Joe
# python version.py #################################################### Checked for running processes. 1 processes currently running, including the current process. Pywikipedia (r5199 (wikipedia.py), Apr 08 2008, 19:34:47) Python 2.4.4c1 (#2, Mar 7 2008, 02:53:24) [GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] #################################################################
# Error message ###################################################### python login.py Checked for running processes. 1 processes currently running, including the current process. Password for user RDFbot on testwiki:en: Logging in to testwiki:en as RDFbot Traceback (most recent call last): File "login.py", line 277, in ? main() File "login.py", line 273, in main loginMan.login() File "login.py", line 219, in login cookiedata = self.getCookie() File "login.py", line 131, in getCookie response, data = self.site.postForm(address, predata, useCookie=False) File "/home/joe/software/wiki/pywikipedia_svn/wikipedia.py", line 4008, in postForm raise ServerError(e) wikipedia.ServerError: (-2, 'Name or service not known') ##############################################################
# user-config.py ##################################################### mylang = 'en' family = 'testwiki' usernames['testwiki']['en'] = 'RDFbot' console_encoding = 'utf-8' #################################################################
# testwiki_family.py #################################################### # -*- coding: utf-8 -*- import family
# The testwiki.
class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'testwiki'
self.langs = { 'en': '"server_path"/testwiki', } self.namespaces[4] = { '_default': u'TestWiki', } self.namespaces[5] = { '_default': u'TestWiki talk', } self.biglangs = ['en'] def path(self, code): return '/%s/index.php' % code #The language code is included in
the path
def version(self, code): return "1.12"
##########################################################
-- Joseph Padfield, joseph.padfield@ng-london.org.uk, Tel: +44 (0)20 7747 2553 Fax: +44 (0)20 7839 3897 Conservation Scientist, Scientific Department, The National Gallery, Trafalgar Square, London, WC2N 5DN
Pompeo Batoni (1708-1787) Until 18 May 2008 Book Now http://www.nationalgallery.org.uk/exhibitions/batoni/tickets.htm Open daily 10am to 6pm, Wednesdays until 9pm
Sign up for the latest news, offers and exclusive competitions from the National Gallery by clicking on this link http://www.nationalgallery.org.uk/what/news/subscribe.htm
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
At the risk of being too obvious (is your computer plugged in?), what happens when you point your web browser to "http://servername.ng-london.org.uk/~joe/testwiki/en/index.php%22?
----- Original Message ----- From: "Joseph Padfield" joseph.padfield@ng-london.org.uk To: "Merlijn van Deen" valhallasw@arctus.nl Cc: pywikipedia-l@lists.wikimedia.org Sent: Wednesday, April 09, 2008 10:35 AM Subject: Re: [Pywikipedia-l] Installation
Hi,
Thanks for the reply,
I do actually have correct path in there, edited it out in the post.
Basically I had 'servername.ng-london.org.uk/~joe/testwiki'
Merlijn van Deen wrote:
In the testwiki_family.py:
self.langs = { 'en': '"server_path"/testwiki', }
that should be 'en': 'localhost/wiki', or whereever your wiki is located.
On Wed, April 9, 2008 2:55 pm, Joseph Padfield wrote:
# user-config.py ##################################################### mylang = 'en' family = 'testwiki' usernames['testwiki']['en'] = 'RDFbot' console_encoding = 'utf-8' #################################################################
# testwiki_family.py #################################################### # -*- coding: utf-8 -*- import family
# The testwiki.
class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'testwiki'
self.langs = { 'en': '"server_path"/testwiki', } self.namespaces[4] = { '_default': u'TestWiki', } self.namespaces[5] = { '_default': u'TestWiki talk', } self.biglangs = ['en'] def path(self, code): return '/%s/index.php' % code #The language code is included in
the path
def version(self, code): return "1.12"
##########################################################
-- Joseph Padfield, joseph.padfield@ng-london.org.uk, Tel: +44 (0)20 7747 2553 Fax: +44 (0)20 7839 3897 Conservation Scientist, Scientific Department, The National Gallery, Trafalgar Square, London, WC2N 5DN
Pompeo Batoni (1708-1787) Until 18 May 2008 Book Now http://www.nationalgallery.org.uk/exhibitions/batoni/tickets.htm Open daily 10am to 6pm, Wednesdays until 9pm
Sign up for the latest news, offers and exclusive competitions from the National Gallery by clicking on this link http://www.nationalgallery.org.uk/what/news/subscribe.htm
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
-- Joseph Padfield, joseph.padfield@ng-london.org.uk, Tel: +44 (0)20 7747 2553 Fax: +44 (0)20 7839 3897 Conservation Scientist, Scientific Department, The National Gallery, Trafalgar Square, London, WC2N 5DN
Pompeo Batoni (1708-1787) Until 18 May 2008 Book Now http://www.nationalgallery.org.uk/exhibitions/batoni/tickets.htm Open daily 10am to 6pm, Wednesdays until 9pm
Sign up for the latest news, offers and exclusive competitions from the National Gallery by clicking on this link http://www.nationalgallery.org.uk/what/news/subscribe.htm
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Yes an obvious question, but good to ask. :-)
The machine is on, its the same one I am working on and yes the web interface to wiki works fine.
Joe
Russell Blau wrote:
At the risk of being too obvious (is your computer plugged in?), what happens when you point your web browser to "http://servername.ng-london.org.uk/~joe/testwiki/en/index.php%22?
----- Original Message ----- From: "Joseph Padfield" joseph.padfield@ng-london.org.uk To: "Merlijn van Deen" valhallasw@arctus.nl Cc: pywikipedia-l@lists.wikimedia.org Sent: Wednesday, April 09, 2008 10:35 AM Subject: Re: [Pywikipedia-l] Installation
Hi,
Thanks for the reply,
I do actually have correct path in there, edited it out in the post.
Basically I had 'servername.ng-london.org.uk/~joe/testwiki'
Merlijn van Deen wrote:
In the testwiki_family.py:
self.langs = { 'en': '"server_path"/testwiki', }
that should be 'en': 'localhost/wiki', or whereever your wiki is located.
On Wed, April 9, 2008 2:55 pm, Joseph Padfield wrote:
# user-config.py ##################################################### mylang = 'en' family = 'testwiki' usernames['testwiki']['en'] = 'RDFbot' console_encoding = 'utf-8' #################################################################
# testwiki_family.py #################################################### # -*- coding: utf-8 -*- import family
# The testwiki.
class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'testwiki'
self.langs = { 'en': '"server_path"/testwiki', } self.namespaces[4] = { '_default': u'TestWiki', } self.namespaces[5] = { '_default': u'TestWiki talk', } self.biglangs = ['en'] def path(self, code): return '/%s/index.php' % code #The language code is
included in the path
def version(self, code): return "1.12"
##########################################################
-- Joseph Padfield, joseph.padfield@ng-london.org.uk, Tel: +44 (0)20 7747 2553 Fax: +44 (0)20 7839 3897 Conservation Scientist, Scientific Department, The National Gallery, Trafalgar Square, London, WC2N 5DN
Pompeo Batoni (1708-1787) Until 18 May 2008 Book Now http://www.nationalgallery.org.uk/exhibitions/batoni/tickets.htm Open daily 10am to 6pm, Wednesdays until 9pm
Sign up for the latest news, offers and exclusive competitions from the National Gallery by clicking on this link http://www.nationalgallery.org.uk/what/news/subscribe.htm
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
-- Joseph Padfield, joseph.padfield@ng-london.org.uk, Tel: +44 (0)20 7747 2553 Fax: +44 (0)20 7839 3897 Conservation Scientist, Scientific Department, The National Gallery, Trafalgar Square, London, WC2N 5DN
Pompeo Batoni (1708-1787) Until 18 May 2008 Book Now http://www.nationalgallery.org.uk/exhibitions/batoni/tickets.htm Open daily 10am to 6pm, Wednesdays until 9pm
Sign up for the latest news, offers and exclusive competitions from the National Gallery by clicking on this link http://www.nationalgallery.org.uk/what/news/subscribe.htm
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Hi
I just wanted to check again if anyone has any suggestions of where I can read more about setting up a pywikipedia bot.
I have downloaded the pywikipedia and it seems to be working, when I point it at Wikipedia the welcome.py script starts returning information. However when I point it at my own new copy of mediawiki it keeps failing, I have attached the output of login.py and welcome.py when I am pointing to my testwiki.
Are there any specific settings that need to be set in Mediawiki to allow Bots to talk to it ? I am currently using the default family file, edited as suggested.
Any help or suggestions of further reading will be very welcome.
Thanks
Joe
################################################################ joe@turner:~/software/wiki/pywikipedia_svn2$ python welcome.py -v Checked for running processes. 1 processes currently running, including the current process. Pywikipediabot (r5218 (wikipedia.py), Apr 13 2008, 14:08:44) Python 2.4.4c1 (#2, Mar 7 2008, 02:53:24) [GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] Retrieving mediawiki messages from Special:Allmessages DBG> BUG: Non-unicode (<type 'str'>) passed to wikipedia.output without decoder! File "welcome.py", line 917, in ? for x in main(settingsBot): File "welcome.py", line 651, in main contrib = string.capitalize(wsite.mediawiki_message('contribslink')) File "/home/joe/software/wiki/pywikipedia_svn2/wikipedia.py", line 4354, in mediawiki_message output('WARNING: No messages found in Special:Allmessages. Maybe the server is down. Retrying in %i minutes...' % retry_idle_time) File "/home/joe/software/wiki/pywikipedia_svn2/wikipedia.py", line 5822, in output print traceback.print_stack() None DBG> Attempting to recover, but please report this problem WARNING: No messages found in Special:Allmessages. Maybe the server is down. Retrying in 1 minutes... Traceback (most recent call last): File "welcome.py", line 917, in ? for x in main(settingsBot): File "welcome.py", line 651, in main contrib = string.capitalize(wsite.mediawiki_message('contribslink')) File "/home/joe/software/wiki/pywikipedia_svn2/wikipedia.py", line 4355, in mediawiki_message time.sleep(retry_idle_time * 60) KeyboardInterrupt joe@turner:~/software/wiki/pywikipedia_svn2$ python login.py -v Checked for running processes. 1 processes currently running, including the current process. Pywikipediabot (r5218 (wikipedia.py), Apr 13 2008, 14:08:44) Python 2.4.4c1 (#2, Mar 7 2008, 02:53:24) [GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] Password for user joe on testwiki:en: Logging in to testwiki:en as joe Traceback (most recent call last): File "login.py", line 277, in ? main() File "login.py", line 273, in main loginMan.login() File "login.py", line 219, in login cookiedata = self.getCookie() File "login.py", line 131, in getCookie response, data = self.site.postForm(address, predata, useCookie=False) File "/home/joe/software/wiki/pywikipedia_svn2/wikipedia.py", line 4006, in postForm raise ServerError(e) wikipedia.ServerError: (-2, 'Name or service not known') joe@turner:~/software/wiki/pywikipedia_svn2$
Joseph Padfield wrote:
Yes an obvious question, but good to ask. :-)
The machine is on, its the same one I am working on and yes the web interface to wiki works fine.
Joe
Russell Blau wrote:
At the risk of being too obvious (is your computer plugged in?), what happens when you point your web browser to "http://servername.ng-london.org.uk/~joe/testwiki/en/index.php%22?
----- Original Message ----- From: "Joseph Padfield" joseph.padfield@ng-london.org.uk To: "Merlijn van Deen" valhallasw@arctus.nl Cc: pywikipedia-l@lists.wikimedia.org Sent: Wednesday, April 09, 2008 10:35 AM Subject: Re: [Pywikipedia-l] Installation
Hi,
Thanks for the reply,
I do actually have correct path in there, edited it out in the post.
Basically I had 'servername.ng-london.org.uk/~joe/testwiki'
Merlijn van Deen wrote:
In the testwiki_family.py:
self.langs = { 'en': '"server_path"/testwiki', }
that should be 'en': 'localhost/wiki', or whereever your wiki is located.
On Wed, April 9, 2008 2:55 pm, Joseph Padfield wrote:
# user-config.py ##################################################### mylang = 'en' family = 'testwiki' usernames['testwiki']['en'] = 'RDFbot' console_encoding = 'utf-8' #################################################################
# testwiki_family.py #################################################### # -*- coding: utf-8 -*- import family
# The testwiki.
class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'testwiki'
self.langs = { 'en': '"server_path"/testwiki', } self.namespaces[4] = { '_default': u'TestWiki', } self.namespaces[5] = { '_default': u'TestWiki talk', } self.biglangs = ['en'] def path(self, code): return '/%s/index.php' % code #The language code is
included in the path
def version(self, code): return "1.12"
##########################################################
-- Joseph Padfield, joseph.padfield@ng-london.org.uk, Tel: +44 (0)20 7747 2553 Fax: +44 (0)20 7839 3897 Conservation Scientist, Scientific Department, The National Gallery, Trafalgar Square, London, WC2N 5DN
Pompeo Batoni (1708-1787) Until 18 May 2008 Book Now http://www.nationalgallery.org.uk/exhibitions/batoni/tickets.htm Open daily 10am to 6pm, Wednesdays until 9pm
Sign up for the latest news, offers and exclusive competitions from the National Gallery by clicking on this link http://www.nationalgallery.org.uk/what/news/subscribe.htm
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
-- Joseph Padfield, joseph.padfield@ng-london.org.uk, Tel: +44 (0)20 7747 2553 Fax: +44 (0)20 7839 3897 Conservation Scientist, Scientific Department, The National Gallery, Trafalgar Square, London, WC2N 5DN
Pompeo Batoni (1708-1787) Until 18 May 2008 Book Now http://www.nationalgallery.org.uk/exhibitions/batoni/tickets.htm Open daily 10am to 6pm, Wednesdays until 9pm
Sign up for the latest news, offers and exclusive competitions from the National Gallery by clicking on this link http://www.nationalgallery.org.uk/what/news/subscribe.htm
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
pywikipedia-l@lists.wikimedia.org