jenkins-bot has submitted this change and it was merged.
Change subject: [BUGFIX] Do not inherit future statements from pwb.py
......................................................................
[BUGFIX] Do not inherit future statements from pwb.py
08ac2d7 imports print_statement from __future__.
This causes customized scripts to fail with syntax error.
Compiling with dont_inherit flag set prevents this.
Bug: T85053
Change-Id: I6f0b3e8c598986a2828ab545758c251d3d592bf6
---
M pwb.py
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
XZise: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/pwb.py b/pwb.py
index ec6840a..1b2cb3e 100644
--- a/pwb.py
+++ b/pwb.py
@@ -77,7 +77,8 @@
try:
source = open(filename).read()
- exec(compile(source, filename, "exec"), main_mod.__dict__)
+ exec(compile(source, filename, "exec", dont_inherit=True),
+ main_mod.__dict__)
finally:
# Restore the old __main__
sys.modules['__main__'] = old_main_mod
--
To view, visit https://gerrit.wikimedia.org/r/181247
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6f0b3e8c598986a2828ab545758c251d3d592bf6
Gerrit-PatchSet: 5
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Fix Python 3 KeyError
......................................................................
Fix Python 3 KeyError
pywikibot global option 'verbose' causes an exception on Python 3.
Replace algorithm with simpler approach that removes only pywikibot
sub-modules like 'wikipedia_family' from the package list.
Change-Id: Ic93b75b7b9e74a66ce3907fa4526e58d694492a5
---
M pywikibot/version.py
1 file changed, 4 insertions(+), 5 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/version.py b/pywikibot/version.py
index 1002ffb..4c02f57 100644
--- a/pywikibot/version.py
+++ b/pywikibot/version.py
@@ -370,12 +370,11 @@
else:
data[name] = info
- # Remove any sub-packages which were loaded with a different name.
+ # Remove any sub-modules which were loaded with a different name.
# e.g. 'wikipedia_family.py' is loaded as 'wikipedia'
+ _program_dir = _get_program_dir()
for path, name in paths.items():
- for other_path in set(paths) - set([path]):
- if path.startswith(other_path) and not other_path.startswith(path):
- del paths[path]
- del data[name]
+ if _program_dir in path:
+ del data[name]
return data
--
To view, visit https://gerrit.wikimedia.org/r/165459
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic93b75b7b9e74a66ce3907fa4526e58d694492a5
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [FEAT] Logentries: Don't duplicate key and show type
......................................................................
[FEAT] Logentries: Don't duplicate key and show type
This doesn't pass the key two times introduced in
bedf6f00b8fdb80b999b6b07a7e4a757644e77cb. It also passes the log type in
which that dictionary was used.
Change-Id: I9fe1f3dd88102daf4d3fb1440d79d85fd89b2dc5
---
M pywikibot/logentries.py
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/logentries.py b/pywikibot/logentries.py
index 750279b..791330e 100644
--- a/pywikibot/logentries.py
+++ b/pywikibot/logentries.py
@@ -25,7 +25,7 @@
def __missing__(self, key):
pywikibot.debug(u"API log entry received:\n" + repr(self),
_logger)
- raise KeyError("Log entry has no '%s' key" % key, key)
+ raise KeyError("Log entry (%s) has no '%s' key" % (self._type, key))
class LogEntry(object):
@@ -44,6 +44,7 @@
if self._expectedType is not None and self._expectedType != self.type():
raise Error("Wrong log type! Expecting %s, received %s instead."
% (self._expectedType, self.type()))
+ self.data._type = self.type()
def __hash__(self):
return self.logid()
--
To view, visit https://gerrit.wikimedia.org/r/181252
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9fe1f3dd88102daf4d3fb1440d79d85fd89b2dc5
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Fix solve_disambiguation
......................................................................
Fix solve_disambiguation
Currently solve_disambigation breaks frequently on English Wikipedia
pages. It is instantiating a Link object with links obtained from
a regex match of the page text, and assuming the Link object doesnt
raise exceptions after instantiation.
Force a Link.parse() on the link text to force errors to occur at the
beginning of processing so the error can be caught and link skipped.
Bug: T85057
Change-Id: I2c874080620a5c777f5bd192421d3fcaa920f219
---
M scripts/solve_disambiguation.py
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py
index 0374f5c..f6bf8bd 100644
--- a/scripts/solve_disambiguation.py
+++ b/scripts/solve_disambiguation.py
@@ -626,6 +626,7 @@
try:
foundlink = pywikibot.Link(m.group('title'),
disambPage.site)
+ foundlink.parse()
except pywikibot.Error:
continue
# ignore interwiki links
--
To view, visit https://gerrit.wikimedia.org/r/181249
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2c874080620a5c777f5bd192421d3fcaa920f219
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
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 <>