Bugs item #2893194, was opened at 2009-11-06 11:46
Message generated for change (Comment added) made by yannforget
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=289319…
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: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Yann Forget (yannforget)
Assigned to: xqt (xqt)
Summary: InvalidTitle Error with fixing_redirects.py
Initial Comment:
$ python fixing_redirects.py "-page:Wikisource:Scriptorium/Août 2007"
Sleeping for 5.0 seconds, 2009-11-06 11:40:49
i>{{EssaiTitre|[[Jules Verne]]|Le Rouge et le
t-weight:bold">[[Jules Verne]]</div>
<div sty
Traceback (most recent call last):
File "fixing_redirects.py", line 219, in <module>
main()
File "fixing_redirects.py", line 207, in main
workon(page)
File "fixing_redirects.py", line 151, in workon
target = page2.getRedirectTarget()
File "/home/yann/wikimedia/bots/pywikipedia/wikipedia.py", line 2383, in
getRedirectTarget
self.get()
File "/home/yann/wikimedia/bots/pywikipedia/wikipedia.py", line 684, in get
self._contents = self._getEditPage(get_redirect = get_redirect, throttle = throttle,
sysop = sysop)
File "/home/yann/wikimedia/bots/pywikipedia/wikipedia.py", line 755, in
_getEditPage
pageInfo = data['query']['pages'].values()[0]
KeyError: 'query'
$ python version.py
Pywikipedia [http] trunk/pywikipedia (r7474, 2009/10/15, 13:31:21)
Python 2.5.2 (r252:60911, Jul 22 2009, 15:33:10)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)]
----------------------------------------------------------------------
Comment By: Yann Forget (yannforget)
Date:
2009-11-08 20:48
Message:
Hello,
I don't think this bug should be closed. This is a real problem, and it
should be fixed.
The bot should not crash for any reason, and specially not for such a
trivial issue.
If it can't edit a page, it should output an error message, but it
shouldn't crash.
Maybe my message wasn't clear: the bot crashes because there is [[ ]] in
the page. I removed this empty link, so the bug could edit the page. But
the bug is still there, and the bot will crash on any other page with this
empty link.
Thanks, Yann
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2009-11-08 12:04
Message:
The bot raises IncalidTitle error of cause the given links where invalid.
This behavior is valid. This is not the same as the KeyError reported
first, so I can close this request.
----------------------------------------------------------------------
Comment By: Yann Forget (yannforget)
Date: 2009-11-08 01:44
Message:
It seems that this edit solves the problem:
http://fr.wikisource.org/w/index.php?title=Portail:Lettres_latines&curi…
----------------------------------------------------------------------
Comment By: Yann Forget (yannforget)
Date: 2009-11-08 01:24
Message:
Yes, still valid with
$ python version.py
Pywikipedia [http] trunk/pywikipedia (r7605, 2009/11/07, 17:10:26)
Python 2.5.2 (r252:60911, Jan 4 2009, 21:59:32)
[GCC 4.3.2]
----------------------------------------------------------------------
Comment By: Yann Forget (yannforget)
Date: 2009-11-08 01:18
Message:
And also with
$ python fixing_redirects.py "-page:Portail:Lettres latines"
>> Portail:Lettres latines <<<
Getting 218 pages from wikisource:fr...
WARNING: Section not found: [[fr:Odes (Horace)#Livre IV]]
ie</h5>
----
* [[Plaute|Plaute]]
----
''[[Amph
Traceback (most recent call last):
File "fixing_redirects.py", line 219, in <module>
main()
File "fixing_redirects.py", line 207, in main
workon(page)
File "fixing_redirects.py", line 154, in workon
text = treat(text, page2, target)
File "fixing_redirects.py", line 89, in treat
actualLinkPage = wikipedia.Page(targetPage.site(), m.group('title'))
File "/home/yann/bots/pywikipedia/wikipedia.py", line 383, in __init__
raise InvalidTitle(u"Invalid title '%s'" % title )
wikipedia.InvalidTitle: Invalid title
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2009-11-06 13:52
Message:
Actual release is 7603. Please actualize your bot.
Is this bug still valid after that?
----------------------------------------------------------------------
Comment By: Yann Forget (yannforget)
Date: 2009-11-06 11:49
Message:
Idem on the Toolserver:
$ python version.py
Pywikipedia [http] trunk/pywikipedia (r7471, 2009/10/14, 21:49:53)
Python 2.5.2 (r252:60911, Jan 4 2009, 21:59:32)
[GCC 4.3.2]
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=289319…