jenkins-bot has submitted this change and it was merged.
Change subject: Fix py2.6 unicode output test cases
......................................................................
Fix py2.6 unicode output test cases
The behavior of streams with an '.encoding' parameter changed
from 2.6 to 2.7: writing unicode is not allowed in 2.6, but
is in 2.7. In 3.x, the latter is the standard behavior.
At least, for stdin/stdout. We can also have a binary file
stream, in which case we have to decide the encoding ourselves.
Change-Id: I29118b548ef95544d0f6a148d76bae109e9cfbe5
---
M pywikibot/userinterfaces/terminal_interface_unix.py
1 file changed, 6 insertions(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/userinterfaces/terminal_interface_unix.py b/pywikibot/userinterfaces/terminal_interface_unix.py
index 4ab6158..da6f43e 100755
--- a/pywikibot/userinterfaces/terminal_interface_unix.py
+++ b/pywikibot/userinterfaces/terminal_interface_unix.py
@@ -6,6 +6,7 @@
#
__version__ = '$Id$'
+import sys
from . import terminal_interface_base
unixColors = {
@@ -41,7 +42,11 @@
# just to be sure, reset the color
text += unixColors['default']
- if hasattr(targetStream, 'encoding') and targetStream.encoding:
+ # .encoding does not mean we can write unicode
+ # to the stream pre-2.7.
+ if sys.version_info >= (2, 7) and \
+ hasattr(targetStream, 'encoding') and \
+ targetStream.encoding:
text = text.encode(targetStream.encoding, 'replace').decode(targetStream.encoding)
targetStream.write(text)
else:
--
To view, visit https://gerrit.wikimedia.org/r/142972
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I29118b548ef95544d0f6a148d76bae109e9cfbe5
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
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: Update of Vikidia and Wikia MediaWiki version
......................................................................
Update of Vikidia and Wikia MediaWiki version
Change-Id: I0e3f635c9a00612a838d5002d279dbafcb407e79
---
M pywikibot/families/vikidia_family.py
M pywikibot/families/wikia_family.py
2 files changed, 2 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
Dereckson: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/pywikibot/families/vikidia_family.py b/pywikibot/families/vikidia_family.py
index 28bc20a..49e2f2f 100644
--- a/pywikibot/families/vikidia_family.py
+++ b/pywikibot/families/vikidia_family.py
@@ -40,7 +40,7 @@
# Which version of MediaWiki is used? REQUIRED
def version(self, code):
# Replace with the actual version being run on your wiki
- return '1.22.6'
+ return '1.23.1'
def code2encoding(self, code):
"""Return the encoding for a specific language wiki"""
diff --git a/pywikibot/families/wikia_family.py b/pywikibot/families/wikia_family.py
index 97d812e..b91bf45 100644
--- a/pywikibot/families/wikia_family.py
+++ b/pywikibot/families/wikia_family.py
@@ -20,7 +20,7 @@
return u'www.wikia.com'
def version(self, code):
- return "1.19.16"
+ return "1.19.17"
def scriptpath(self, code):
return ''
--
To view, visit https://gerrit.wikimedia.org/r/142969
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0e3f635c9a00612a838d5002d279dbafcb407e79
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Linedwell <Linedwell(a)icloud.com>
Gerrit-Reviewer: Dereckson <dereckson(a)espace-win.org>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Linedwell <Linedwell(a)icloud.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: Update of Vikidia and Wikia MediaWiki version
......................................................................
Update of Vikidia and Wikia MediaWiki version
Change-Id: Ia821a16ab5cec84293677c6bfc44c136af28d693
---
M families/vikidia_family.py
M families/wikia_family.py
2 files changed, 2 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
Dereckson: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/families/vikidia_family.py b/families/vikidia_family.py
index 9f4c5d1..23ceb0c 100644
--- a/families/vikidia_family.py
+++ b/families/vikidia_family.py
@@ -106,7 +106,7 @@
# Which version of MediaWiki is used? REQUIRED
def version(self, code):
# Replace with the actual version being run on your wiki
- return '1.22.6'
+ return '1.23.1'
def code2encoding(self, code):
"""Return the encoding for a specific language wiki"""
diff --git a/families/wikia_family.py b/families/wikia_family.py
index 68bce91..a49576a 100644
--- a/families/wikia_family.py
+++ b/families/wikia_family.py
@@ -39,7 +39,7 @@
return u'www.wikia.com'
def version(self, code):
- return "1.19.16"
+ return "1.19.17"
def scriptpath(self, code):
return ''
--
To view, visit https://gerrit.wikimedia.org/r/142971
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia821a16ab5cec84293677c6bfc44c136af28d693
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Linedwell <Linedwell(a)icloud.com>
Gerrit-Reviewer: Dereckson <dereckson(a)espace-win.org>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Linedwell <Linedwell(a)icloud.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Do not print thread info under unittests
......................................................................
Do not print thread info under unittests
On Python 2.6, this causes errors. Everywhere else it is
confusing to have differences between running tests individually
vs as a batch via setup.py
Change-Id: I7ea207f1f9e994e7542ac93eb4130ea60ad646a0
---
M scripts/archivebot.py
1 file changed, 3 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/archivebot.py b/scripts/archivebot.py
index 018c225..8b073e8 100644
--- a/scripts/archivebot.py
+++ b/scripts/archivebot.py
@@ -277,7 +277,9 @@
self.header += line + '\n'
if cur_thread:
self.threads.append(cur_thread)
- if pywikibot.calledModuleName() != 'archivebot_tests':
+ # This extra info is not desirable when run under the unittest
+ # framework, which may be run either directly or via setup.py
+ if pywikibot.calledModuleName() not in ['archivebot_tests', 'setup']:
pywikibot.output(u'%d Threads found on %s'
% (len(self.threads), self))
--
To view, visit https://gerrit.wikimedia.org/r/142984
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7ea207f1f9e994e7542ac93eb4130ea60ad646a0
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
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: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: textlib.py: pyflakes fix
......................................................................
textlib.py: pyflakes fix
local variable '_line' is assigned to but never used
Change-Id: I03925ef12228c3969442def3af11fc1ba7b641d8
---
M pywikibot/textlib.py
1 file changed, 0 insertions(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index d561b73..47b9f7a 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -1232,7 +1232,6 @@
-. year, month, hour, time, day, minute, tzinfo
"""
- _line = line
# match date fields
dateDict = dict()
for pat in self.patterns:
--
To view, visit https://gerrit.wikimedia.org/r/142882
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I03925ef12228c3969442def3af11fc1ba7b641d8
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <mpaa.wiki(a)gmail.com>
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: pagegenerators.py: pyflakes fixes
......................................................................
pagegenerators.py: pyflakes fixes
- 'time' imported but unused
- remove redefinition of unused 'date'
Change-Id: I71937e4ef2cbc0cf579ed7b530f9d6fb52f9dc34
---
M pywikibot/pagegenerators.py
1 file changed, 1 insertion(+), 2 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index e69ef05..025c732 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -23,7 +23,6 @@
import codecs
import itertools
import re
-import time
import pywikibot
from pywikibot import date
from pywikibot import config
@@ -1123,7 +1122,7 @@
def AncientPagesPageGenerator(total=100, site=None):
if site is None:
site = pywikibot.Site()
- for page, date in site.ancientpages(total=total):
+ for page, timestamp in site.ancientpages(total=total):
yield page
--
To view, visit https://gerrit.wikimedia.org/r/142862
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I71937e4ef2cbc0cf579ed7b530f9d6fb52f9dc34
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <mpaa.wiki(a)gmail.com>
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: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: checkimages.py: pyflake fixes
......................................................................
checkimages.py: pyflake fixes
local variable 'usage' is assigned to but never used
local variable 'image_to_resub' is assigned to but never used
local variable 'pos' is assigned to but never used
Change-Id: I35b7ef6a8eefe3861817b2877d97e35b6ce0c5ea
---
M scripts/checkimages.py
1 file changed, 0 insertions(+), 3 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index e361c38..b19aba6 100644
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -888,7 +888,6 @@
def returnOlderTime(self, listGiven, timeListGiven):
""" Get some time and return the oldest of them """
- usage = False
num = 0
num_older = None
max_usage = 0
@@ -1115,7 +1114,6 @@
if len(images_to_tag_list) != 0 and not only_report:
already_reported_in_past = self.countEdits(
u'File:%s' % images_to_tag_list[-1], self.botolist)
- image_to_resub = images_to_tag_list[-1]
from_regex = r'\n\*\[\[:File:%s\]\]' \
% re.escape(self.convert_to_url(
self.imageName))
@@ -1488,7 +1486,6 @@
def load(self, raw):
""" Load a list of objects from a string using regex. """
list_loaded = []
- pos = 0
# I search with a regex how many user have not the talk page
# and i put them in a list (i find it more easy and secure)
regl = r"(\"|\')(.*?)\1(?:,|\])"
--
To view, visit https://gerrit.wikimedia.org/r/142863
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I35b7ef6a8eefe3861817b2877d97e35b6ce0c5ea
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Fix mock Site classes
......................................................................
Fix mock Site classes
I5e480be86a0b7b6a5907cf71690ba9ebed0b04b6 depended on Site having
_loginstatus, which was not added to the mock Site subclasses in the
test suite.
Change-Id: I94df9e30b328bfab6892954ba8d6c443efa33d49
---
M tests/dry_api_tests.py
M tests/dry_site_tests.py
2 files changed, 4 insertions(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/dry_api_tests.py b/tests/dry_api_tests.py
index 7d30ccc..95870ff 100644
--- a/tests/dry_api_tests.py
+++ b/tests/dry_api_tests.py
@@ -48,6 +48,8 @@
# Mock basesite object to test this.
class MockSite(pywikibot.site.APISite):
+ _loginstatus = pywikibot.site.LoginStatus.NOT_ATTEMPTED
+
_namespaces = {2: 'User'}
def __init__(self):
diff --git a/tests/dry_site_tests.py b/tests/dry_site_tests.py
index 042b14e..19f95a0 100644
--- a/tests/dry_site_tests.py
+++ b/tests/dry_site_tests.py
@@ -14,6 +14,8 @@
class DrySite(pywikibot.site.APISite):
+ _loginstatus = pywikibot.site.LoginStatus.NOT_ATTEMPTED
+
@property
def userinfo(self):
return self._userinfo
--
To view, visit https://gerrit.wikimedia.org/r/142857
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I94df9e30b328bfab6892954ba8d6c443efa33d49
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Nullzero <nullzero.free(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Unix TUI: make sure to only feed the stream acceptable characters
......................................................................
Unix TUI: make sure to only feed the stream acceptable characters
If targetStream.encoding='ascii', we cannot feed it non-ascii
characters. We therefore have to encode using 'replace' (which
will turn all non-ascii characters into ?'s), then decode,
then feed it as unicode (py3 str) into the stream.
Then the stream will decode it again, and show it to the user.
Should fix the archiveBot test failures.
Change-Id: I1655e28b19cfe1aada0d29fd912c214b9b6de5ca
---
M pywikibot/userinterfaces/terminal_interface_unix.py
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/userinterfaces/terminal_interface_unix.py b/pywikibot/userinterfaces/terminal_interface_unix.py
index 915ccca..4ab6158 100755
--- a/pywikibot/userinterfaces/terminal_interface_unix.py
+++ b/pywikibot/userinterfaces/terminal_interface_unix.py
@@ -41,7 +41,8 @@
# just to be sure, reset the color
text += unixColors['default']
- if hasattr(targetStream, 'encoding'):
+ if hasattr(targetStream, 'encoding') and targetStream.encoding:
+ text = text.encode(targetStream.encoding, 'replace').decode(targetStream.encoding)
targetStream.write(text)
else:
targetStream.write(text.encode(self.encoding, 'replace'))
--
To view, visit https://gerrit.wikimedia.org/r/142831
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1655e28b19cfe1aada0d29fd912c214b9b6de5ca
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>