jenkins-bot has submitted this change and it was merged.
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(-)
Approvals:
Ladsgroup: Looks good to me, approved
jenkins-bot: Verified
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: merged
Gerrit-Change-Id: I959e054945c707dcf92ff7061532758e0e1ce9a9
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
DrTrigon has submitted this change and it was merged.
Change subject: work-a-round; for "MaxTriesExceededError", "EditConflict" (and - hopefully - all others) in catimages.py during debug info/log output
......................................................................
work-a-round; for "MaxTriesExceededError", "EditConflict" (and - hopefully - all others) in catimages.py during debug info/log output
Change-Id: I770022be418e7d904ab22138f8524e8d3ac581cd
---
M catimages.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
DrTrigon: Verified; Looks good to me, approved
diff --git a/catimages.py b/catimages.py
index e91084f..b748658 100644
--- a/catimages.py
+++ b/catimages.py
@@ -4422,7 +4422,7 @@
% len(tmp[:pos]))
outpage.put(tmp[:pos], comment="bot writing log for last run")
tmp = tmp[pos:]
- except pywikibot.MaxTriesExceededError:
+ except: # catch MaxTriesExceededError, EditConflict and all other
pywikibot.exception()
pywikibot.output(u"Problem writing debug info to wiki, using file instead.")
if pywikibot.simulate or tmp:
--
To view, visit https://gerrit.wikimedia.org/r/98458
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I770022be418e7d904ab22138f8524e8d3ac581cd
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: DrTrigon <dr.trigon(a)surfeu.ch>
Gerrit-Reviewer: DrTrigon <dr.trigon(a)surfeu.ch>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: Use bytes-based url (un)quote for py3k
......................................................................
Use bytes-based url (un)quote for py3k
Change-Id: I6f78e4e0ab25f47558b44e7053f6b9c7e29d3c15
---
M pywikibot/page.py
1 file changed, 8 insertions(+), 3 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 0de6559..759093a 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -21,8 +21,13 @@
import logging
import re
import unicodedata
-import urllib
import collections
+
+import urllib
+try:
+ from urllib.parse import quote_from_bytes, unquote_to_bytes
+except ImportError:
+ from urllib import quote as quote_from_bytes, unquote as unquote_to_bytes
logger = logging.getLogger("pywiki.wiki.page")
@@ -167,7 +172,7 @@
title = title.replace(u' ', u'_')
if asUrl:
encodedTitle = title.encode(self.site.encoding())
- title = urllib.quote(encodedTitle)
+ title = quote_from_bytes(encodedTitle)
if as_filename:
# Replace characters that are not possible in file names on some
# systems.
@@ -3527,7 +3532,7 @@
for enc in encList:
try:
t = title.encode(enc)
- t = urllib.unquote(t)
+ t = unquote_to_bytes(t)
return unicode(t, enc)
except UnicodeError as ex:
if not firstException:
--
To view, visit https://gerrit.wikimedia.org/r/98271
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6f78e4e0ab25f47558b44e7053f6b9c7e29d3c15
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: list-ify range
......................................................................
list-ify range
Change-Id: Iea093bf60b8805bdec02a744f5c24a343718a759
---
M pywikibot/family.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/family.py b/pywikibot/family.py
index cc88490..1688235 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -105,7 +105,7 @@
self.langs = {}
- self.namespacesWithSubpage = [2] + range(1, 16, 2)
+ self.namespacesWithSubpage = [2] + list(range(1, 16, 2))
# letters that can follow a wikilink and are regarded as part of
# this link
--
To view, visit https://gerrit.wikimedia.org/r/98388
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iea093bf60b8805bdec02a744f5c24a343718a759
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot