Last modified: 2013-12-29 12:54:14 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T59879, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 57879 - impossible to run solve_disambiguation.py on redirects
impossible to run solve_disambiguation.py on redirects
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
compat-(1.0)
All All
: Unprioritized major
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-02 20:08 UTC by Hercule
Modified: 2013-12-29 12:54 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Hercule 2013-12-02 20:08:32 UTC
Since yesterday I can't run solve_disambiguation.py with -redir option. 
The command line is :

python solve_disambiguation.py -redir Agence France Presse

The error stack is :

Traceback (most recent call last):
  File "solve_disambiguation.py", line 1147, in <module>
    main()
  File "solve_disambiguation.py", line 1142, in main
    bot.run()
  File "solve_disambiguation.py", line 1018, in run
    if not self.findAlternatives(disambPage):
  File "solve_disambiguation.py", line 897, in findAlternatives
    target = disambPage.getRedirectTarget().title()
  File "/data/project/herculebot/pywikibot-compat/wikipedia.py", line 3120, in getRedirectTarget
    target = err[0].replace('&amp;quot;', '"')
AttributeError: 'IsRedirectPage' object has no attribute 'replace'

version.Py output is :
Pywikibot: [https] r/pywikibot/compat (r10559, 341ed66, 2013/12/01, 19:41:39, OUTDATED)
Release version: 1.0b1
Python: 2.7.3 (default, Sep 26 2013, 20:03:06)
[GCC 4.6.3]
config-settings:
use_api = True
use_api_login = True
unicode test: ok
Comment 1 xqt 2013-12-03 14:03:54 UTC
-redir is not a valid option of the actual framework. Could you explain.
Comment 2 Hercule 2013-12-03 14:12:59 UTC
-redir is an option to indicate that the script run from a redirect.

See the documentation :
http://www.mediawiki.org/wiki/Manual:Pywikibot/solve_disambiguation.py
Comment 3 Gerrit Notification Bot 2013-12-03 14:24:37 UTC
Change 98813 had a related patch set uploaded by Xqt:
(bug 57879): raise the right form for isRedirectPage exception

https://gerrit.wikimedia.org/r/98813
Comment 4 Hercule 2013-12-03 14:27:17 UTC
I discover that this parameter is inactive since 8 years...

https://git.wikimedia.org/commitdiff/pywikibot%2Fcompat.git/0e153e659cf6f6b7e5770b142719b818f3fe9b1e

So the correct description of the bug is that launching solve_disambiguation.py from a redirect crashes. Few days ago there was no problem
Comment 5 Gerrit Notification Bot 2013-12-03 14:29:26 UTC
Change 98814 had a related patch set uploaded by Ladsgroup:
Fast fixation of the Bug: 57879

https://gerrit.wikimedia.org/r/98814
Comment 6 Gerrit Notification Bot 2013-12-03 14:37:25 UTC
Change 98814 merged by jenkins-bot:
Fast fixation of the Bug: 57879

https://gerrit.wikimedia.org/r/98814
Comment 7 Amir Ladsgroup 2013-12-03 14:44:57 UTC
can you update your codes and run it again?
Comment 8 Gerrit Notification Bot 2013-12-03 14:46:15 UTC
Change 98818 had a related patch set uploaded by Xqt:
Revert "Fast fixation of the Bug: 57879"

https://gerrit.wikimedia.org/r/98818
Comment 9 Gerrit Notification Bot 2013-12-03 14:47:49 UTC
Change 98818 merged by Xqt:
Revert "Fast fixation of the Bug: 57879"

https://gerrit.wikimedia.org/r/98818
Comment 10 Amir Ladsgroup 2013-12-03 15:02:07 UTC
sorry for this issue. I just wanted to help :(
Comment 11 Gerrit Notification Bot 2013-12-03 15:06:45 UTC
Change 98813 merged by jenkins-bot:
(bug 57879): raise the right form for isRedirectPage exception

https://gerrit.wikimedia.org/r/98813
Comment 12 Merlijn van Deen (test) 2013-12-29 12:38:18 UTC
Just a note on this for future reference.

- Page._redirarg can be either str or IsRedirectError(str, ), depending on where it is set
- If Page._redirarg is set, it is used to re-throw the error when page.get() (et al.) are called a second time.

The old syntax
  throw IsRedirectError, e

will throw IsRedirectError(e) if e is str, or IsRedirectError(e.msg) if e is Exception.

The new syntax
  throw IsRedirectError(e)

will *always* throw IsRedirectError(e), which will therefore result in IsRedirectError(IsRedirectError(page title)) if e is Exception.
Comment 13 Gerrit Notification Bot 2013-12-29 12:46:56 UTC
Change 104344 had a related patch set uploaded by Xqt:
notice for bug 57879

https://gerrit.wikimedia.org/r/104344
Comment 14 Gerrit Notification Bot 2013-12-29 12:54:14 UTC
Change 104344 merged by jenkins-bot:
notice for bug 57879

https://gerrit.wikimedia.org/r/104344

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links