Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #3626
Status: Errored
Duration: 31 minutes and 8 seconds
Commit: 936170b (master)
Author: zhuyifei1999
Message: Site.editpage: Moving locking mechanism into a try...finally block
Repetition is the root of all evil. One place where self.unlock_page(page)
is forgotten can cause a deadlock.
Try...finally block is used everywhere else for unlocking in Site except
for editpage.
Bug: T145633
Change-Id: Ia5738f651fa23ab1a62d0f3ead85e0dbf4856136
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/2d2d51b759ac...936170b7…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/159867784
--
You can configure recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications
jenkins-bot has submitted this change and it was merged.
Change subject: Revert "[bugfix] fix tests for wikidata"
......................................................................
Revert "[bugfix] fix tests for wikidata"
This reverts commit 8816913e4320dbac94c0d18926803ee8f5e8d44b.
Bug: T134655
Change-Id: Ib435c5c64a3744f43aef639364dfbbd3b6712b08
---
M tests/wikibase_tests.py
1 file changed, 0 insertions(+), 17 deletions(-)
Approvals:
John Vandenberg: Looks good to me, but someone else must approve
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py
index 6cfceaf..7b747e3 100644
--- a/tests/wikibase_tests.py
+++ b/tests/wikibase_tests.py
@@ -1131,30 +1131,13 @@
},
}
- def test_own_repository(self, key):
- """Test that a data repository family is its own repository."""
- site = self.get_site(key)
- self.assertEqual(site, site.data_repository())
- self.assertTrue(site.is_data_repository)
-
def test_own_client(self, key):
"""Test that a data repository family can be its own client."""
site = self.get_site(key)
- self.assertTrue(site.has_data_repository)
- def test_item_exists(self):
- """Test that a ItemPage exists for wikidata:wikidata."""
- site = self.get_site('wikidata')
page = pywikibot.Page(site, 'Wikidata:Main Page')
item = pywikibot.ItemPage.fromPage(page)
self.assertEqual(item.site, site)
-
- def test_item_not_exists(self):
- """Test that a ItemPage does not exists for test:wikidata."""
- site = self.get_site('wikidatatest')
- page = pywikibot.Page(site, 'Wikidata:Main Page')
- with self.assertRaises(pywikibot.NoPage):
- pywikibot.ItemPage.fromPage(page)
class TestUnconnectedClient(TestCase):
--
To view, visit https://gerrit.wikimedia.org/r/298452
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib435c5c64a3744f43aef639364dfbbd3b6712b08
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: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Print additional warning when starting a thread fails
......................................................................
Print additional warning when starting a thread fails
- print a warning to decrease max_external_links
- increase sleeping time before starting a new thread to config.retry_wait value
to wait a longer time until a previous thread was finished.
Bug: T145273
Change-Id: I1cebcfa6e49f0e68975d7e9062e1dd3825b9a7ac
---
M scripts/weblinkchecker.py
1 file changed, 10 insertions(+), 3 deletions(-)
Approvals:
Mpaa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/weblinkchecker.py b/scripts/weblinkchecker.py
index 9f5abb5..44e3296 100755
--- a/scripts/weblinkchecker.py
+++ b/scripts/weblinkchecker.py
@@ -862,13 +862,20 @@
# Limit the number of threads started at the same time. Each
# thread will check one page, then die.
while threading.activeCount() >= config.max_external_links:
- # wait 100 ms
- time.sleep(0.1)
+ time.sleep(config.retry_wait)
thread = LinkCheckThread(page, url, self.history,
self.HTTPignore, self.day)
# thread dies when program terminates
thread.setDaemon(True)
- thread.start()
+ try:
+ thread.start()
+ except threading.ThreadError:
+ pywikibot.warning(
+ "Can't start a new thread.\nPlease decrease "
+ "max_external_links in your user-config.py or use\n"
+ "'-max_external_links:' option with a smaller value. "
+ "Default is 50.")
+ raise
def RepeatPageGenerator():
--
To view, visit https://gerrit.wikimedia.org/r/309730
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1cebcfa6e49f0e68975d7e9062e1dd3825b9a7ac
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
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: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #3618
Status: Errored
Duration: 39 minutes and 1 second
Commit: 5ad5181 (master)
Author: Alex Monk
Message: Default wikimedia rcstream to https on port 443
Instead of http on port 80
This commit itself is not tested (I'm not a pywikibot user), though I have
checked my own little socketIO_client script and it should be okay.
Bug: T145244
Change-Id: I4a01817ba7e525f3ebdf82cab939ac8bbcdf1835
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/6453e15141d4...5ad51816…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/158849183
--
You can configure recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications
jenkins-bot has submitted this change and it was merged.
Change subject: Default wikimedia rcstream to https on port 443
......................................................................
Default wikimedia rcstream to https on port 443
Instead of http on port 80
This commit itself is not tested (I'm not a pywikibot user), though I have
checked my own little socketIO_client script and it should be okay.
Bug: T145244
Change-Id: I4a01817ba7e525f3ebdf82cab939ac8bbcdf1835
---
M pywikibot/comms/rcstream.py
M pywikibot/family.py
2 files changed, 10 insertions(+), 5 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/comms/rcstream.py b/pywikibot/comms/rcstream.py
index 3e67ed2..823597a 100644
--- a/pywikibot/comms/rcstream.py
+++ b/pywikibot/comms/rcstream.py
@@ -45,7 +45,7 @@
is passed to rcstream using a 'subscribe' command. Pass
'*' to listen to all wikis for a given rc host.
@param rchost: the recent changes stream host to connect to. For Wikimedia
- wikis, this is 'stream.wikimedia.org'
+ wikis, this is 'https://stream.wikimedia.org'
@param rcport: the port to connect to (default: 80)
@param rcpath: the sockets.io path. For Wikimedia wikis, this is '/rc'.
(default: '/rc')
@@ -58,7 +58,7 @@
Usage:
- >>> t = RcListenerThread('en.wikipedia.org', 'stream.wikimedia.org')
+ >>> t = RcListenerThread('en.wikipedia.org', 'https://stream.wikimedia.org')
>>> t.start()
>>> change = t.queue.get()
>>> change
@@ -164,7 +164,7 @@
is passed to rcstream using a 'subscribe' command. Pass
'*' to listen to all wikis for a given rc host.
@param rchost: the recent changes stream host to connect to. For Wikimedia
- wikis, this is 'stream.wikimedia.org'
+ wikis, this is 'https://stream.wikimedia.org'
@param rcport: the port to connect to (default: 80)
@param rcpath: the sockets.io path. For Wikimedia wikis, this is '/rc'.
(default: '/rc')
@@ -218,5 +218,6 @@
return rc_listener(
wikihost=site.hostname(),
rchost=site.rcstream_host(),
+ rcport=site.rcstream_port(),
total=total,
)
diff --git a/pywikibot/family.py b/pywikibot/family.py
index c95f2e5..6058e6d 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -1612,8 +1612,12 @@
return 'https'
def rcstream_host(self, code):
- """Return 'stream.wikimedia.org' as the RCStream hostname."""
- return 'stream.wikimedia.org'
+ """Return 'https://stream.wikimedia.org' as the RCStream hostname."""
+ return 'https://stream.wikimedia.org'
+
+ def rcstream_port(self, code):
+ """Return 443 as the RCStream port number."""
+ return 443
class WikimediaOrgFamily(SingleSiteFamily, WikimediaFamily):
--
To view, visit https://gerrit.wikimedia.org/r/309632
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4a01817ba7e525f3ebdf82cab939ac8bbcdf1835
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <alex(a)wikimedia.org>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: 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: [IMPR] Provide global step parameter via config2.py
......................................................................
[IMPR] Provide global step parameter via config2.py
step parameter is reimplemented as config setting used by api.
It could be set either in user_config.py or given as global
option -step:<value>.
As before, default is 50 and setting could be overwriten
by set_query_increment() during runtime.
Bug: T109208
Change-Id: I02c6ea9c1a8fc6c3cd4fdf1e39f7317b671ffa10
---
M pywikibot/bot.py
M pywikibot/config2.py
M pywikibot/data/api.py
M pywikibot/pagegenerators.py
4 files changed, 23 insertions(+), 16 deletions(-)
Approvals:
Mpaa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 895e56f..bb986e2 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -908,7 +908,7 @@
daemonize.daemonize(redirect_std=redirect_std)
else:
# the argument depends on numerical config settings
- # e.g. -maxlag:
+ # e.g. -maxlag and -step:
try:
_arg = option[1:]
# explicitly check for int (so bool doesn't match)
diff --git a/pywikibot/config2.py b/pywikibot/config2.py
index 0491846..de34c9b 100644
--- a/pywikibot/config2.py
+++ b/pywikibot/config2.py
@@ -618,6 +618,10 @@
# running solve_disambiguation.py with the -primary argument.
special_page_limit = 500
+# Maximum of pages which can be retrieved at one time from wiki server.
+# -1 indicates limit by api restriction
+step = -1
+
# Maximum number of times to retry an API request before quitting.
max_retries = 25
# Minimum time to wait before resubmitting a failed API request.
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index a42caf6..1db496c 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Interface to Mediawiki's api.php."""
#
-# (C) Pywikibot team, 2007-2015
+# (C) Pywikibot team, 2007-2016
#
# Distributed under the terms of the MIT license.
#
@@ -2383,7 +2383,10 @@
self.limit_name = limit_name
self.data_name = data_name
- self.query_increment = 50
+ if config.step > 0:
+ self.query_increment = config.step
+ else:
+ self.query_increment = None
self.limit = None
self.starting_offset = kwargs['parameters'].pop(self.continue_name, 0)
self.request = self.request_class(**kwargs)
@@ -2393,7 +2396,7 @@
"""
Set the maximum number of items to be retrieved per API query.
- If not called, the default is 50.
+ If not called, the default is config.step.
@param value: The value of maximum number of items to be retrieved
per API request to set.
@@ -2544,7 +2547,10 @@
else:
self.request[prefix + 'limit'] = int(param["max"])
- self.api_limit = None
+ if config.step > 0:
+ self.api_limit = config.step
+ else:
+ self.api_limit = None
if self.limited_module:
self.prefix = self.site._paraminfo['query+' + self.limited_module]['prefix']
@@ -2607,13 +2613,15 @@
param = self.site._paraminfo.parameter('query+' + self.limited_module,
'limit')
if self.site.logged_in() and self.site.has_right('apihighlimits'):
- self.api_limit = int(param["highmax"])
+ limit = int(param['highmax'])
else:
- self.api_limit = int(param["max"])
- pywikibot.debug(u"%s: Set query_limit to %i."
- % (self.__class__.__name__,
- self.api_limit),
- _logger)
+ limit = int(param['max'])
+ if self.api_limit is None or limit < self.api_limit:
+ self.api_limit = limit
+ pywikibot.debug(
+ '{0}: Set query_limit to {1}.'.format(self.__class__.__name__,
+ self.api_limit),
+ _logger)
def set_namespace(self, namespaces):
"""Set a namespace filter on this query.
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index 6a59a1d..4507db4 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -696,11 +696,6 @@
u'What namespace are you filtering on?')
self._namespaces += value.split(",")
return True
- elif arg == '-step':
- issue_deprecation_warning(
- 'The usage of "{0}"'.format(arg), None, 2,
- ArgumentDeprecationWarning)
- return False
elif arg == '-limit':
if not value:
value = pywikibot.input('What is the limit value?')
--
To view, visit https://gerrit.wikimedia.org/r/274991
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I02c6ea9c1a8fc6c3cd4fdf1e39f7317b671ffa10
Gerrit-PatchSet: 10
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>