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=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.
https://bugzilla.wikimedia.org/show_bug.cgi?id=61312
Bug ID: 61312
Summary: protect.py should have different messages for
protect/unprotect pages
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: minor
Priority: Unprioritized
Component: General
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: info(a)gno.de
Web browser: ---
Mobile Platform: ---
Now we have the same edit summary for both operations
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=62261
Bug ID: 62261
Summary: Throw specific error instead of generic APIError if
claim target is deleted
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: minor
Priority: Unprioritized
Component: Wikidata
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: felix(a)fex-it.de
Web browser: ---
Mobile Platform: ---
If adding a claim, two types of errors are thrown in case of a deleted item:
item = pywikibot.ItemPage(repo, "Q726")
target = pywikibot.ItemPage(repo, "Q14854094")
c = pywikibot.Claim(repo, u'P171')
c.addTarget(target)
item.addClaim(c) # Error if item or target were deleted
At the last line, you get either
pywikibot.exceptions.NoPage: Page [[wikidata:-1]] doesn't exist.
if item (Q726) has been deleted or
pywikibot.data.api.APIError: invalid-snak-value: Q14854094 not found
if the target (Q14854094) has been deleted.
It would be great, if for the latter a specific "InvalidValueError" or similar
would be thrown. Then, the error could be caught and handled specifically
without the need to parse the (possibly changing) API error message itself.
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=55011
Web browser: ---
Bug ID: 55011
Summary: Support for Wikimedia Labs and Toolserver
Product: Pywikibot
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: enhancement
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/feature-requests/335/
Reported by: cdpark
Created on: 2013-04-08 01:52:09
Subject: Support for Wikimedia Labs and Toolserver
Original description:
1\. Source directory repositiory
Split pywikipedia source and user config/script. See also
https://wikitech.wikimedia.org/wiki/Nova\_Resource\_Talk:Bots\#Pywikipediab…
Currently, pywikipedia imports\(or includes\) other file from \(1\) source code
directory \(2\) current working directory \(3\) pywikipedia environment,
depends on code. How about to support PYWIKIPEDIA\_HOME or similar environment
for source code repository.
2\. Local mysql mirror support.
In WMLabs and toolserver, access of wikipedia mirror is available. Page.get\(\)
and pagegenerators can be use this information. \(BTW, Page.put\(\) should work
to original site, not mirrors\). It can be also useful for other mediawiki
installs if admin runs some pywikipedia-based script \(e.g. replace.py\) for
his own database.
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=55054
Web browser: ---
Bug ID: 55054
Summary: Add new section to a page
Product: Pywikibot
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: enhancement
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/feature-requests/273/
Reported by: binbot
Created on: 2010-11-07 16:57:49
Subject: Add new section to a page
Original description:
Hi\! Wikipedia.Page has now to saving methods, put\(newtext\) and
put\_async\(newtext\). I ask you to introduce a third one:
newsection\(title,newtext\). It should work as ...action=edit§ion=new, so
we shouldn't bother the old content of the page to add something to the end.
Thanks a lot\!
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=55104
Web browser: ---
Bug ID: 55104
Summary: Recreate deleted page
Product: Pywikibot
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: enhancement
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/feature-requests/144/
Reported by: Anonymous user
Created on: 2008-04-19 14:50:59
Subject: Recreate deleted page
Original description:
I searched and found closed and open bugs on recreating deleted pages, but I
think I can put it differently than others:
I \*want\* to use pagefromfile to upload a large amount of text that a user
upload badly by hand. Those pages have been deleted and would be much better
created en masse by the bot. I understand why most people would not want their
bots creating previously deleted pages, but it should be an option. Even if I
had to hit "Y" every time like I do with deletes, it should be possible.
I tried removing the pertaining objections in wikipedia.py, but the layout on
editing a previously deleted page is too different.
This should be an easy error to recreate.
mrandmrsmurphy(a)gmail.com
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=58941
Web browser: ---
Bug ID: 58941
Summary: [tracking] Missing unit tests
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Keywords: easy
Severity: normal
Priority: Unprioritized
Component: General
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: valhallasw(a)arctus.nl
Blocks: 58940
Classification: Unclassified
Mobile Platform: ---
This is a bug to track unit tests that should be added. These bugs might be
interesting for new contributors.
--
You are receiving this mail because:
You are the assignee for the bug.