https://bugzilla.wikimedia.org/show_bug.cgi?id=55889
Web browser: ---
Bug ID: 55889
Summary: Thread-safe versions of the Generators
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: Unprioritized
Component: General
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: crangasi2001(a)yahoo.com
Classification: Unclassified
Mobile Platform: ---
Currently, the generators functions use yield, which is not tread-safe. PWB
should offer a thread-safe version using one of the many interesting
suggestions from http://www.dabeaz.com/generators/Generators.pdf (or any other
method :P)
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=55158
Web browser: ---
Bug ID: 55158
Summary: getFileVersionHistory doesn't work if information is
hidden
Product: Pywikibot
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: General
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: legoktm.wikipedia(a)gmail.com
Classification: Unclassified
Mobile Platform: ---
Originally from: http://sourceforge.net/p/pywikipediabot/bugs/1550/
Reported by: stefan2wiki
Created on: 2012-12-14 01:38:42
Subject: getFileVersionHistory doesn't work if information is hidden
Original description:
Take a file where some information is hidden, for example this one:
https://commons.wikimedia.org/wiki/File:Catania\_Piazza\_Quattro\_Canti.jpg
In this case, the edit summary for the first revision is missing.
Try this code:
import wikipedia
site = wikipedia.getSite\(u'commons', u'commons'\)
page = wikipedia.ImagePage\(site, u'File:Catania Piazza Quattro Canti.jpg'\)
history = page.getFileVersionHistory\(\)
I get an error message:
Traceback \(most recent call last\):
File "<stdin>", line 1, in <module>
File "wikipedia.py", line 4194, in getFileVersionHistory
result.append\(\(i\['timestamp'\], i\['user'\], u"%s×%s" % \(i\['width'\],
i\['height'\]\), i\['size'\], i\['comment'\]\)\)
KeyError: 'comment'
There is no i\['comment'\] because the comment is hidden \(deleted\).
Result: The script crashes when running getFileVersionHistory. It would be
better if getFileVersionHistory at least returns what's available, instead of
returning nothing at all. For example, if you use i.get\('comment'\) instead of
i\['comment'\], then getFileVersionHistory returns None if there is no comment.
That seems much better than crashing.
Some version information:
Pywikipedia \(r10715 \(wikipedia.py\), 2012/11/13, 20:56:05\)
Python 2.7.3 \(default, Aug 1 2012, 05:16:07\)
\[GCC 4.6.3\]
config-settings:
use\_api = True
use\_api\_login = True
unicode test: ok
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=68617
Bug ID: 68617
Summary: editarticle uses deprecated optparser
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: General
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: jayvdb(a)gmail.com
Web browser: ---
Mobile Platform: ---
optparser was deprecated in py 2.7
https://docs.python.org/2/library/argparse.html#module-argparse
It is used by editarticle.py
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=64358
Bug ID: 64358
Summary: Incorrect EditConflict Exception
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: Unprioritized
Component: General
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: zhuyifei1999(a)gmail.com
CC: info(a)gno.de
Web browser: ---
Mobile Platform: ---
Site.upload may trigger EditConflict when using Page.save if page is loaded
before the upload.
EditConflict is raised in site.py line 2796-2798:
if lastrev is not None and page.latestRevision() != lastrev:
raise EditConflict(
"editpage: Edit conflict detected; saving aborted.")
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=59678
Web browser: ---
Bug ID: 59678
Summary: Implement badtoken detection and recovery
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: General
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: maarten(a)mdammers.nl
Classification: Unclassified
Mobile Platform: ---
Every once in a while I get a badtoken exception. This is probably because I
have multiple bots running on the same site at the same time (race condition).
* Bot A requests token -> 123
* Bot B requests token -> 123
* Bot A edits with token 123 -> ok
* Bot B edits with token 123 -> poof
We could of course implement very difficult synchronization, but it doesn't
happen very often so it's probably better handle it like a collision in
ethernet.
* Detect the badtoken
* Back off for a random number of seconds
* Get a new token
* Do the edit
Max tries should be respected so the bot can't get into a infinite retry loop.
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=68671
Bug ID: 68671
Summary: test duration [tracking]
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: Unprioritized
Component: tests
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: jayvdb(a)gmail.com
Web browser: ---
Mobile Platform: ---
The following tests take longer than 10s on travis-ci for the enwp py2.7 build
testQueryApiGetter (tests.wikidataquery_tests.TestApiSlowFunctions) ...
10.522s ok
...
testLinkMethods (tests.site_tests.TestSiteObject)
Test site methods for getting links to and from a page ... Retrieving 5 pages
from wikipedia:en.
344.035s ok
...
testWebCiteOlder (tests.weblib_tests.TestArchiveSites) ... 16.051s ok
...
testLinks (tests.page_tests.TestPageObject) ... 15.409s ok
...
https://travis-ci.org/wikimedia/pywikibot-core/jobs/30944822
testLinkMethods is the worst, and many parts of it do not depend on the
initialisation at the beginning of the method.
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=59973
Web browser: ---
Bug ID: 59973
Summary: Pywikibot should have a
wikibase-error-sitelink-already-used exception
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: Wikidata
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: maarten(a)mdammers.nl
Classification: Unclassified
Mobile Platform: ---
At the moment when you try to add a sitelink to an item at Wikidata that's
already used, you'll get a pywikibot.data.api.APIError.
Sitelink to Commons Category:Mormonism based on P373
failed-save
Site link [//commons.wikimedia.org/wiki/Category:Mormonism Category:Mormonism]
is already used by item [[Q8808767]]. Perhaps the items should be
[[Help:Merge|merged]] and one of them [[Wikidata:Deletion policy|deleted]]?
Request deletion of one of the items at [[Wikidata:Requests for deletion]], or
ask at [[Wikidata:Interwiki conflicts]] if you believe that they should not be
merged.
{u'messages': {u'0': {u'type': u'error', u'name':
u'wikibase-error-sitelink-already-used', u'parameters':
[u'//commons.wikimedia.org/wiki/Category:Mormonism', u'Category:Mormonism',
u'Q8808767', u'commonswiki']}, u'html': {u'*': u'<p>Site link <a
class="external text"
href="//commons.wikimedia.org/wiki/Category:Mormonism">Category:Mormonism</a>
is already used by item <a href="/wiki/Q8808767" title="Q8808767">Q8808767</a>.
Perhaps the items should be <a href="/wiki/Help:Merge"
title="Help:Merge">merged</a> and one of them <a
href="/wiki/Wikidata:Deletion_policy" title="Wikidata:Deletion
policy">deleted</a>? Request deletion of one of the items at <a
href="/wiki/Wikidata:Requests_for_deletion" title="Wikidata:Requests for
deletion" class="mw-redirect">Wikidata:Requests for deletion</a>, or ask at <a
href="/wiki/Wikidata:Interwiki_conflicts" title="Wikidata:Interwiki
conflicts">Wikidata:Interwiki conflicts</a> if you believe that they should not
be merged.\n</p>'}}}
This is a bit too low level for me. This should be caught by either site or
page and a WikiBase exception should be thrown.
The behavior should probably be modeled after the IsRedirectPage exception. We
might want to create some more Wikibase exceptions while we're at it, but I
haven't looked into that.
PageRelatedError
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=59227
Web browser: ---
Bug ID: 59227
Summary: pywikibot.data.api.APIError:
internal_api_error_ReadOnlyError when the database is
locked
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: General
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: maarten(a)mdammers.nl
Classification: Unclassified
Mobile Platform: ---
Database is locked at the moment. Makes the pywikibot crash with this error:
Adding new Commons category claim to [[Commons:Category:Green Party of British
Columbia]] based on [[en:Category:Green Party of British Columbia]]
Traceback (most recent call last):
File "C:\pywikibot\core\commonscat_to_wikidata.py", line 238, in <module>
main()
File "C:\pywikibot\core\commonscat_to_wikidata.py", line 235, in main
bot.run()
File "C:\pywikibot\core\commonscat_to_wikidata.py", line 94, in run
newclaim.addSource(source, bot=True)
File "C:\pywikibot\core\pywikibot\page.py", line 2957, in addSource
self.addSources([claim], **kwargs)
File "C:\pywikibot\core\pywikibot\page.py", line 2965, in addSources
data = self.repo.editSource(self, claims, new=True, **kwargs)
File "C:\pywikibot\core\pywikibot\site.py", line 720, in callee
return fn(self, *args, **kwargs)
File "C:\pywikibot\core\pywikibot\site.py", line 3797, in editSource
data = req.submit()
File "C:\pywikibot\core\pywikibot\data\api.py", line 401, in submit
raise APIError(code, info, **result["error"])
pywikibot.data.api.APIError: internal_api_error_ReadOnlyError: Exception
Caught:
The database is currently locked to new entries and other modifications,
probably for routine database maintenance, after which it will be back to
normal.
The administrator who locked it offered this explanation: The database has been
automatically locked while the slave database servers catch up to the master
Should be caught like any other api error, back off, wait some time. Try again
until we reach max tries.
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=56321
Web browser: ---
Bug ID: 56321
Summary: Locked database makes bot crash with
"pywikibot.data.api.APIError"
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: Wikidata
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: maarten(a)mdammers.nl
Classification: Unclassified
Mobile Platform: ---
" File "C:\pywikibot\core\pywikibot\page.py", line 2692, in addClaim
self.repo.addClaim(self, claim, bot=bot, **kwargs)
File "C:\pywikibot\core\pywikibot\site.py", line 709, in callee
return fn(self, *args, **kwargs)
File "C:\pywikibot\core\pywikibot\site.py", line 3581, in addClaim
data = req.submit()
File "C:\pywikibot\core\pywikibot\data\api.py", line 394, in submit
raise APIError(code, info, **result["error"])
pywikibot.data.api.APIError: internal_api_error_ReadOnlyError: Exception
Caught:
The database is currently locked to new entries and other modifications,
probab
ly for routine database maintenance, after which it will be back to normal.
The administrator who locked it offered this explanation: The database has been
automatically locked while the slave database servers catch up to the master
"
Should back off and retry
--
You are receiving this mail because:
You are the assignee for the bug.