Ladsgroup has uploaded a new change for review.

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


Change subject: Fast fixation of the Bug: 57879
......................................................................

Fast fixation of the Bug: 57879

The problem in this code is we call page.get() (indirectly) two times and the 
exception behave inproperly in this situation,

so I bypassed (not fixed) this error by introducing a new variable in order to 
avoid caching

Bug: 57879
Change-Id: I959e054945c707dcf92ff7061532758e0e1ce9a9
---
M solve_disambiguation.py
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat 
refs/changes/14/98814/1

diff --git a/solve_disambiguation.py b/solve_disambiguation.py
index 8fe8cd6..41550b0 100644
--- a/solve_disambiguation.py
+++ b/solve_disambiguation.py
@@ -894,7 +894,8 @@
                 self.alternatives += links
             else:
                 try:
-                    target = disambPage.getRedirectTarget().title()
+                    disambPage2 = pywikibot.Page(disambPage.site(), 
disambPage.title())
+                    target = disambPage2.getRedirectTarget().title()
                     self.alternatives.append(target)
                 except pywikibot.NoPage:
                     pywikibot.output(u"The specified page was not found.")

-- 
To view, visit https://gerrit.wikimedia.org/r/98814
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I959e054945c707dcf92ff7061532758e0e1ce9a9
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <ladsgr...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to