Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #1872
Status: Fixed
Duration: 40 minutes and 1 second
Commit: 030cbd9 (master)
Author: Mpaa
Message: Compute page length in bytes in test_allpages_pagesize
API:allpages assumes page length is in bytes.
site.encoding() is used to convert from unicode to bytes.
Bug: T85663
Change-Id: I2cb49ba31543d7c48c71f25e686e2e7ede1b0122
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/f3b4cc5cb404...030cbd93…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/45623216
--
You can configure recipients for build notifications in your .travis.yml file. See http://docs.travis-ci.com/user/notifications
jenkins-bot has submitted this change and it was merged.
Change subject: Compute page length in bytes in test_allpages_pagesize
......................................................................
Compute page length in bytes in test_allpages_pagesize
API:allpages assumes page length is in bytes.
site.encoding() is used to convert from unicode to bytes.
Bug: T85663
Change-Id: I2cb49ba31543d7c48c71f25e686e2e7ede1b0122
---
M tests/site_tests.py
1 file changed, 6 insertions(+), 3 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py
index eb377c4..eecbb74 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -430,15 +430,18 @@
for page in mysite.allpages(minsize=100, total=5):
self.assertIsInstance(page, pywikibot.Page)
self.assertTrue(mysite.page_exists(page))
- self.assertGreaterEqual(len(page.text), 100)
+ self.assertGreaterEqual(len(page.text.encode(mysite.encoding())),
+ 100)
for page in mysite.allpages(maxsize=200, total=5):
self.assertIsInstance(page, pywikibot.Page)
self.assertTrue(mysite.page_exists(page))
- if len(page.text) > 200 and mysite.data_repository() == mysite:
+ if (len(page.text.encode(mysite.encoding())) > 200 and
+ mysite.data_repository() == mysite):
print('%s.text is > 200 bytes while raw JSON is <= 200'
% page)
continue
- self.assertLessEqual(len(page.text), 200)
+ self.assertLessEqual(len(page.text.encode(mysite.encoding())),
+ 200)
def test_allpages_protection(self):
mysite = self.get_site()
--
To view, visit https://gerrit.wikimedia.org/r/182422
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2cb49ba31543d7c48c71f25e686e2e7ede1b0122
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 <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #1871
Status: Broken
Duration: 40 minutes and 32 seconds
Commit: f3b4cc5 (master)
Author: Fabian Neundorf
Message: [IMPROV] Site: Warn more detailed if site to old
If the site to old and the value would be valid for new versions, it's
specifically saying that the site doesn't support that value and not
that the value is invalid at all.
Change-Id: I1a00a8dbcb5a4ee94d89222543e574f14a77184e
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/2aef17aaeae0...f3b4cc5c…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/45598351
--
You can configure recipients for build notifications in your .travis.yml file. See http://docs.travis-ci.com/user/notifications
jenkins-bot has submitted this change and it was merged.
Change subject: [IMPROV] Site: Warn more detailed if site to old
......................................................................
[IMPROV] Site: Warn more detailed if site to old
If the site to old and the value would be valid for new versions, it's
specifically saying that the site doesn't support that value and not
that the value is invalid at all.
Change-Id: I1a00a8dbcb5a4ee94d89222543e574f14a77184e
---
M pywikibot/site.py
1 file changed, 8 insertions(+), 6 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 188272a..973edaf 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -4008,14 +4008,16 @@
params['createonly'] = ""
if nocreate:
params['nocreate'] = ""
- watch_items = ["watch", "unwatch"]
- if MediaWikiVersion(self.version()) >= MediaWikiVersion("1.16"):
- watch_items += ["preferences", "nochange"]
+ watch_items = set(["watch", "unwatch", "preferences", "nochange"])
if watch in watch_items:
- if MediaWikiVersion(self.version()) >= MediaWikiVersion("1.16"):
- params['watchlist'] = watch
+ if MediaWikiVersion(self.version()) < MediaWikiVersion("1.16"):
+ if watch in ['preferences', 'nochange']:
+ pywikibot.warning(u'The watch value {0} is not supported '
+ 'by {1}'.format(watch, self))
+ else:
+ params[watch] = ""
else:
- params[watch] = ""
+ params['watchlist'] = watch
elif watch:
pywikibot.warning(
u"editpage: Invalid watch value '%(watch)s' ignored."
--
To view, visit https://gerrit.wikimedia.org/r/182403
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1a00a8dbcb5a4ee94d89222543e574f14a77184e
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 <>