Bugs item #3019985, was opened at 2010-06-22 23:19
Message generated for change (Comment added) made by winston365
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3019985&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Winston (winston365)
Assigned to: Nobody/Anonymous (nobody)
Summary: Page.getReferences hangs for [[Nintendo DS]]
Initial Comment:
list(wikipedia.Page(wikipedia.Site('en'), 'Nintendo DS').getReferences()) seems to hang, and eventually causes a maximum recursion depth exception. The generator is created, but is never exhausted, so it never finishes when cast into a list. It looks like the offending page may be [[Wikipedia talk:Articles for creation/Boing! Docomodake DS]], and getReferences on that page hangs in the same way. It seems to be looping continuously in the "for zms" loop around line 1276 in wikipedia.py, almost as if the page was redirecting to itself.
Pywikipedia [http] trunk/pywikipedia (r8194, 2010/05/18, 15:27:06)
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3]
config-settings:
use_api = True
use_api_login = True
----------------------------------------------------------------------
>Comment By: Winston (winston365)
Date: 2010-06-24 18:03
Message:
I have attached a simple patch that seems to work around this for now.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3019985&group_…
Bugs item #3020887, was opened at 2010-06-24 18:31
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3020887&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Dan Nessett (dnessett)
>Assigned to: xqt (xqt)
Summary: redirectRegex throws type error
Initial Comment:
Running MW 1.13.2, the following command throws a type error:
$ python add_text.py -cat:Pages_with_too_many_expensive_parser_function_calls -text:" " -summary:"Test edit:Category jog for [[:Category:Pages with too many expensive parser function calls|Pages with too many expensive parser function calls]]"
The result is:
Getting [[Category:Pages with too many expensive parser function calls]]...
Loading 2009 White House Forum on Health Reform/Related Articles...
Do you want to accept these changes? ([y]es, [N]o, [a]ll) a
Updating page [[2009 White House Forum on Health Reform/Related Articles]] via API
Loading 2010 United Kingdom general election/Related Articles...
Traceback (most recent call last):
File "add_text.py", line 417, in <module>
main()
File "add_text.py", line 413, in main
create=talkPage)
File "add_text.py", line 201, in add_text
text = page.get()
File "/usr/local/src/python/pywikipedia/local_sites/wikipedia.py", line 619, in get
self._contents = self._getEditPage(get_redirect = get_redirect, throttle = throttle, sysop = sysop)
File "/usr/local/src/python/pywikipedia/local_sites/wikipedia.py", line 727, in _getEditPage
m = self.site().redirectRegex().match(pagetext)
File "/usr/local/src/python/pywikipedia/local_sites/wikipedia.py", line 6644, in redirectRegex
pattern = r'(?:' + '|'.join(keywords) + ')'
TypeError
version.py output is:
$ python version.py
Pywikipedia [http] trunk/pywikipedia (r8311, 2010/06/22, 13:20:10)
Python 2.5.2 (r252:60911, Jan 20 2010, 21:48:48)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)]
config-settings:
use_api = True
use_api_login = True
This error occurs due to the following bug in the code. At line 6642 is the following code fragment:
try:
keywords = self.getmagicwords('redirect')
pattern = r'(?:' + '|'.join(keywords) + ')'
except KeyError:
# no localized keyword for redirects
pattern = r'#%s' % default
getmagicwords is a one line method that simply calls siteinfo (line 5480) with the key 'magicwords'. At line 5518, siteinfo calls getData to obtain site data. When looking for magicwords, the method executes "for entry in data[key]" at line 5527. For certain versions of MW, magicwords are not returned as part of the site data and therefore data[key] returns a null result. Eventually, this leads to the KeyError exception at line 5538.
The bug arises because siteinfo catches the KeyError exception and returns a result of "None". When the call is unwound back to line 6643 the provision for a KeyError at line 6645 is vacuous. The KeyError has already been caught by siteinfo.
Consequently, the statement at line 6644 executes. This causes a TypeError since the keyword arguement to .join() is null.
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2010-06-24 23:29
Message:
Thanks a lot for analyzing it and these details. I'll fix it tomorrow.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3020887&group_…
Bugs item #3020887, was opened at 2010-06-24 09:31
Message generated for change (Tracker Item Submitted) made by dnessett
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3020887&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Dan Nessett (dnessett)
Assigned to: Nobody/Anonymous (nobody)
Summary: redirectRegex throws type error
Initial Comment:
Running MW 1.13.2, the following command throws a type error:
$ python add_text.py -cat:Pages_with_too_many_expensive_parser_function_calls -text:" " -summary:"Test edit:Category jog for [[:Category:Pages with too many expensive parser function calls|Pages with too many expensive parser function calls]]"
The result is:
Getting [[Category:Pages with too many expensive parser function calls]]...
Loading 2009 White House Forum on Health Reform/Related Articles...
Do you want to accept these changes? ([y]es, [N]o, [a]ll) a
Updating page [[2009 White House Forum on Health Reform/Related Articles]] via API
Loading 2010 United Kingdom general election/Related Articles...
Traceback (most recent call last):
File "add_text.py", line 417, in <module>
main()
File "add_text.py", line 413, in main
create=talkPage)
File "add_text.py", line 201, in add_text
text = page.get()
File "/usr/local/src/python/pywikipedia/local_sites/wikipedia.py", line 619, in get
self._contents = self._getEditPage(get_redirect = get_redirect, throttle = throttle, sysop = sysop)
File "/usr/local/src/python/pywikipedia/local_sites/wikipedia.py", line 727, in _getEditPage
m = self.site().redirectRegex().match(pagetext)
File "/usr/local/src/python/pywikipedia/local_sites/wikipedia.py", line 6644, in redirectRegex
pattern = r'(?:' + '|'.join(keywords) + ')'
TypeError
version.py output is:
$ python version.py
Pywikipedia [http] trunk/pywikipedia (r8311, 2010/06/22, 13:20:10)
Python 2.5.2 (r252:60911, Jan 20 2010, 21:48:48)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)]
config-settings:
use_api = True
use_api_login = True
This error occurs due to the following bug in the code. At line 6642 is the following code fragment:
try:
keywords = self.getmagicwords('redirect')
pattern = r'(?:' + '|'.join(keywords) + ')'
except KeyError:
# no localized keyword for redirects
pattern = r'#%s' % default
getmagicwords is a one line method that simply calls siteinfo (line 5480) with the key 'magicwords'. At line 5518, siteinfo calls getData to obtain site data. When looking for magicwords, the method executes "for entry in data[key]" at line 5527. For certain versions of MW, magicwords are not returned as part of the site data and therefore data[key] returns a null result. Eventually, this leads to the KeyError exception at line 5538.
The bug arises because siteinfo catches the KeyError exception and returns a result of "None". When the call is unwound back to line 6643 the provision for a KeyError at line 6645 is vacuous. The KeyError has already been caught by siteinfo.
Consequently, the statement at line 6644 executes. This causes a TypeError since the keyword arguement to .join() is null.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3020887&group_…
Bugs item #3020485, was opened at 2010-06-24 00:56
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3020485&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: other
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: alchimista ()
Assigned to: xqt (xqt)
Summary: category_redirect.py and featured.py fixes
Initial Comment:
Please add pt localization to category_redirect and featured.py. The changes are at http://pywiki.pastey.net/137993-1l4k and http://pywiki.pastey.net/137994-41a3 . Just added summary's and templates, and have tested the category one, wich works fine.
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2010-06-24 17:27
Message:
doen in r8319. Thanks!
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2010-06-24 08:43
Message:
featured.py fixed in r8315.
I found these characters in pastey for category_redirect where not
unicoded and denied it. Could you give me a patch file?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3020485&group_…
Bugs item #3020101, was opened at 2010-06-23 12:32
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3020101&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: other
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: xqt (xqt)
Summary: Can't use -ref and -namespace with fixing_redirect.py
Initial Comment:
When use -ref:"One page" and -namespace:0, the script start to check every page of the namespace 0 and not pages in namespace 0 of reference.
So, we can't use -ref and -namespace at the same time.
Myst
$ python version.py
Pywikipedia [http] trunk/pywikipedia (r8311, 2010/06/22, 13:20:10)
Python 2.5.5 (r255:77872, Apr 21 2010, 08:44:16)
[GCC 4.4.3]
config-settings:
use_api = True
use_api_login = True
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2010-06-24 09:47
Message:
done in r8316
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3020101&group_…
Bugs item #3020485, was opened at 2010-06-24 00:56
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3020485&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: other
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: alchimista ()
>Assigned to: xqt (xqt)
Summary: category_redirect.py and featured.py fixes
Initial Comment:
Please add pt localization to category_redirect and featured.py. The changes are at http://pywiki.pastey.net/137993-1l4k and http://pywiki.pastey.net/137994-41a3 . Just added summary's and templates, and have tested the category one, wich works fine.
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2010-06-24 08:43
Message:
featured.py fixed in r8315.
I found these characters in pastey for category_redirect where not
unicoded and denied it. Could you give me a patch file?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3020485&group_…
Bugs item #3020485, was opened at 2010-06-23 22:56
Message generated for change (Tracker Item Submitted) made by
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3020485&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: other
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: alchimista ()
Assigned to: Nobody/Anonymous (nobody)
Summary: category_redirect.py and featured.py fixes
Initial Comment:
Please add pt localization to category_redirect and featured.py. The changes are at http://pywiki.pastey.net/137993-1l4k and http://pywiki.pastey.net/137994-41a3 . Just added summary's and templates, and have tested the category one, wich works fine.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3020485&group_…
Bugs item #3020101, was opened at 2010-06-23 10:32
Message generated for change (Tracker Item Submitted) made by nobody
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3020101&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: other
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Can't use -ref and -namespace with fixing_redirect.py
Initial Comment:
When use -ref:"One page" and -namespace:0, the script start to check every page of the namespace 0 and not pages in namespace 0 of reference.
So, we can't use -ref and -namespace at the same time.
Myst
$ python version.py
Pywikipedia [http] trunk/pywikipedia (r8311, 2010/06/22, 13:20:10)
Python 2.5.5 (r255:77872, Apr 21 2010, 08:44:16)
[GCC 4.4.3]
config-settings:
use_api = True
use_api_login = True
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3020101&group_…
Bugs item #3019985, was opened at 2010-06-22 23:19
Message generated for change (Tracker Item Submitted) made by winston365
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3019985&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Winston (winston365)
Assigned to: Nobody/Anonymous (nobody)
Summary: Page.getReferences hangs for [[Nintendo DS]]
Initial Comment:
list(wikipedia.Page(wikipedia.Site('en'), 'Nintendo DS').getReferences()) seems to hang, and eventually causes a maximum recursion depth exception. The generator is created, but is never exhausted, so it never finishes when cast into a list. It looks like the offending page may be [[Wikipedia talk:Articles for creation/Boing! Docomodake DS]], and getReferences on that page hangs in the same way. It seems to be looping continuously in the "for zms" loop around line 1276 in wikipedia.py, almost as if the page was redirecting to itself.
Pywikipedia [http] trunk/pywikipedia (r8194, 2010/05/18, 15:27:06)
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3]
config-settings:
use_api = True
use_api_login = True
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3019985&group_…
Bugs item #3018240, was opened at 2010-06-18 19:32
Message generated for change (Comment added) made by russblau
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3018240&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: rewrite
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Nakor Wikipedia (nakor-wikipedia)
Assigned to: Russell Blau (russblau)
Summary: [pywikibot] page.getReferences returns incorrect list
Initial Comment:
Hello,
Try below code in pywikipedia (you ahve to set your bot to go on fr.wiki):
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wikipedia
site = wikipedia.getSite()
page = wikipedia.Page(site, u'Modèle:Suppression')
referencesGenerator=page.getReferences(follow_redirects=False, withTemplateInclusion=False, onlyTemplateInclusion=False, redirectsOnly=True)
print len(list(referencesGenerator))
result is correct: 7 pages redirecting to that one
Now run the following code using pywikibot:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import pywikibot
site = pywikibot.getSite()
page = pywikibot.Page(site, u'Modèle:Suppression')
referencesGenerator=page.getReferences(follow_redirects=False, withTemplateInclusion=False, onlyTemplateInclusion=False, redirectsOnly=True)
print len(list(referencesGenerator))
result is incorrect: 1681
----------------------------------------------------------------------
>Comment By: Russell Blau (russblau)
Date: 2010-06-22 15:50
Message:
Fixed in r8312
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3018240&group_…