[Pywikipedia-bugs] [Maniphest] [Updated] T261591: pywikibot's site.editpage() with recreate=False does not allow creation of pages not previously deleted

2020-08-30 Thread JJMC89
JJMC89 removed a project: Patch-For-Review.

TASK DETAIL
  https://phabricator.wikimedia.org/T261591

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: JJMC89
Cc: Aklapper, pywikibot-bugs-list, JJMC89, JohnsonLee01, SHEKH, Dijkstra, 
Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, Mdupont, Dvorapa, Altostratus, 
Avicennasis, mys_721tx, jayvdb, Masti, Alchimista, Rxy, Alter-paule, Beast1978, 
Un1tY, Hook696, Kent7301, joker88john, CucyNoiD, Gaboe420, Giuliamocci, 
Cpaulf30, Af420, Bsandipan, Lewizho99, Maathavan
___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Commented On] T261591: pywikibot's site.editpage() with recreate=False does not allow creation of pages not previously deleted

2020-08-30 Thread gerritbot
gerritbot added a comment.


  Change 623221 **abandoned** by JJMC89:
  [pywikibot/core@master] [doc] Update site.editpage()'s recreate parameter
  
  Reason:
  pywikibot's implementation does not match the API parameter
  
  https://gerrit.wikimedia.org/r/623221

TASK DETAIL
  https://phabricator.wikimedia.org/T261591

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: gerritbot
Cc: Aklapper, pywikibot-bugs-list, JJMC89, JohnsonLee01, SHEKH, Dijkstra, 
Alter-paule, Beast1978, Un1tY, Khutuck, Zkhalido, Hook696, Kent7301, 
joker88john, Viztor, CucyNoiD, Wenyi, Gaboe420, Giuliamocci, Cpaulf30, Af420, 
Bsandipan, Tbscho, MayS, Lewizho99, Mdupont, Maathavan, Dvorapa, Altostratus, 
Avicennasis, mys_721tx, jayvdb, Masti, Alchimista, Rxy
___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Updated] T261591: pywikibot's site.editpage() with recreate=False does not allow creation of pages not previously deleted

2020-08-30 Thread gerritbot
gerritbot added a project: Patch-For-Review.

TASK DETAIL
  https://phabricator.wikimedia.org/T261591

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: gerritbot
Cc: Aklapper, pywikibot-bugs-list, JJMC89, JohnsonLee01, SHEKH, Dijkstra, 
Alter-paule, Beast1978, Un1tY, Khutuck, Zkhalido, Hook696, Kent7301, 
joker88john, Viztor, CucyNoiD, Wenyi, Gaboe420, Giuliamocci, Cpaulf30, Af420, 
Bsandipan, Tbscho, MayS, Lewizho99, Mdupont, Maathavan, Dvorapa, Altostratus, 
Avicennasis, mys_721tx, jayvdb, Masti, Alchimista, Rxy
___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Commented On] T261591: pywikibot's site.editpage() with recreate=False does not allow creation of pages not previously deleted

2020-08-30 Thread gerritbot
gerritbot added a comment.


  Change 623221 had a related patch set uploaded (by JJMC89; owner: JJMC89):
  [pywikibot/core@master] [doc] Update site.editpage()'s recreate parameter
  
  https://gerrit.wikimedia.org/r/623221

TASK DETAIL
  https://phabricator.wikimedia.org/T261591

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: gerritbot
Cc: Aklapper, pywikibot-bugs-list, JJMC89, JohnsonLee01, SHEKH, Dijkstra, 
Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, Mdupont, Dvorapa, Altostratus, 
Avicennasis, mys_721tx, jayvdb, Masti, Alchimista, Rxy
___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Closed] T261591: pywikibot's site.editpage() with recreate=False does not allow creation of pages not previously deleted

2020-08-30 Thread JJMC89
JJMC89 closed this task as "Invalid".
JJMC89 added a comment.


  Aparently the pywikibot parameter doc is wrong. It should be `if True 
(default), ignore any errors about the page having been deleted in the 
meantime` instead of `if True (default), create new page even if this title has 
previously been deleted`.

TASK DETAIL
  https://phabricator.wikimedia.org/T261591

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: JJMC89
Cc: Aklapper, pywikibot-bugs-list, JJMC89, JohnsonLee01, SHEKH, Dijkstra, 
Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, Mdupont, Dvorapa, Altostratus, 
Avicennasis, mys_721tx, jayvdb, Masti, Alchimista, Rxy
___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Created] T261591: pywikibot's site.editpagewith recreate=False does not allow creation of pages not previously deleted

2020-08-30 Thread JJMC89
JJMC89 created this task.
JJMC89 added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  Steps to Reproduce:
  
>>> import pywikibot
>>> site = pywikibot.Site()
>>> site
APISite("test", "wikipedia")
>>> page = pywikibot.Page(site, 'Test pwb recreate')  # Does not exist and 
hasn't been deleted
>>> page
Page('Test pwb recreate')
>>> page.exists()
False
>>> page.text = 'Testing'
>>> page.save(recreate=False)
  
  Actual Results:
  
Traceback (most recent call last):
  File "/shared/pywikipedia/core/pywikibot/page/__init__.py", line 99, in 
handle
func(self, *args, **kwargs)
  File "/shared/pywikipedia/core/pywikibot/page/__init__.py", line 1315, in 
_save
watch=watch, bot=botflag, **kwargs)
  File "/shared/pywikipedia/core/pywikibot/site/_decorators.py", line 94, 
in callee
return fn(self, *args, **kwargs)
  File "/shared/pywikipedia/core/pywikibot/site/__init__.py", line 5162, in 
editpage
lastrev = page.latest_revision
  File "/shared/pywikipedia/core/pywikibot/page/__init__.py", line 602, in 
latest_revision
return next(self.revisions(content=True, total=1))
  File "/shared/pywikipedia/core/pywikibot/tools/__init__.py", line 1434, 
in wrapper
return obj(*__args, **__kw)
  File "/shared/pywikipedia/core/pywikibot/page/__init__.py", line 1756, in 
revisions
total=total)
  File "/shared/pywikipedia/core/pywikibot/tools/__init__.py", line 1434, 
in wrapper
return obj(*__args, **__kw)
  File "/shared/pywikipedia/core/pywikibot/tools/__init__.py", line 1517, 
in wrapper
return obj(*new_args, **new_kwargs)
  File "/shared/pywikipedia/core/pywikibot/site/__init__.py", line 4008, in 
loadrevisions
raise NoPage(page)
pywikibot.exceptions.NoPage: Page [[test:Test pwb recreate]] doesn't exist.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "/shared/pywikipedia/core/pywikibot/tools/__init__.py", line 1434, 
in wrapper
return obj(*__args, **__kw)
  File "/shared/pywikipedia/core/pywikibot/tools/__init__.py", line 1434, 
in wrapper
return obj(*__args, **__kw)
  File "/shared/pywikipedia/core/pywikibot/page/__init__.py", line 1304, in 
save
cc=apply_cosmetic_changes, quiet=quiet, **kwargs)
  File "/shared/pywikipedia/core/pywikibot/page/__init__.py", line 120, in 
wrapper
handle(func, self, *args, **kwargs)
  File "/shared/pywikipedia/core/pywikibot/page/__init__.py", line 112, in 
handle
raise pywikibot.OtherPageSaveError(self, err)
pywikibot.exceptions.OtherPageSaveError: Edit to page [[Test pwb recreate]] 
failed:
Page [[test:Test pwb recreate]] doesn't exist.
  
  Expected Results:
  
  The page is created with the text `Testing` just like it would be if using 
the API directly:
  
  name=request
{
"action": "edit",
"format": "json",
"title": "Test API recreate",
"text": "Testing",
"token": ""
}
  
  
  
  name=response
{
"edit": {
"new": "",
"result": "Success",
"pageid": 115743,
"title": "Test API recreate",
"contentmodel": "wikitext",
"oldrevid": 0,
"newrevid": 447041,
"newtimestamp": "2020-08-31T03:35:21Z"
}
}
  
  The current behavior with `recreate=False` is like `nocreate=True`.
  
  name=request
{
"action": "edit",
"format": "json",
"title": "Test API nocreate",
"text": "Testing",
"nocreate": 1,
"token": ""
}
  
  name=response
{
"error": {
"code": "missingtitle",
"info": "The page you specified doesn't exist.",
"*": "See https://test.wikipedia.org/w/api.php for API usage. 
Subscribe to the mediawiki-api-announce mailing list at 
; for 
notice of API deprecations and breaking changes."
},
"servedby": "mw1410"
}
  
  
  
  
  
  Version: 4.2.1.dev0 (75aca06 
)

TASK DETAIL
  https://phabricator.wikimedia.org/T261591

WORKBOARD
  https://phabricator.wikimedia.org/project/board/87/

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: JJMC89
Cc: Aklapper, pywikibot-bugs-list, JJMC89, JohnsonLee01, SHEKH, Dijkstra, 
Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, Mdupont, Dvorapa, Altostratus, 
Avicennasis, mys_721tx, jayvdb, Masti, Alchimista, Rxy
___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Retitled] T261591: pywikibot's site.editpage() with recreate=False does not allow creation of pages not previously deleted

2020-08-30 Thread JJMC89
JJMC89 renamed this task from "pywikibot's site.editpagewith recreate=False 
does not allow creation of pages not previously deleted" to "pywikibot's 
site.editpage() with recreate=False does not allow creation of pages not 
previously deleted".

TASK DETAIL
  https://phabricator.wikimedia.org/T261591

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: JJMC89
Cc: Aklapper, pywikibot-bugs-list, JJMC89, JohnsonLee01, SHEKH, Dijkstra, 
Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, Mdupont, Dvorapa, Altostratus, 
Avicennasis, mys_721tx, jayvdb, Masti, Alchimista, Rxy
___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Commented On] T261050: Frequent "Invalid CSRF token" errors on Wikimedia Commons using Pywikibot since August 2020

2020-08-30 Thread Multichill
Multichill added a comment.


  I think this happens:
  
  - Bot fires up and gets some tokens
  - Bot does a lot of edits all with the same token
  - For some reason after a long time the token is not valid anymore
  - The bot continues to try to edit with the old invalid token instead of 
getting a new one
  
  How long is a token supposed to be valid? Forever? The Pywikibot code seems 
to assume that it can use the same token for all edits in a one run. One run 
can take days or weeks. As a work around I now force the site to get a new 
token when I run into a problem. That seems to be stable.
  
  So I think Pywikibot needs to be updated in the framework itself that if it 
runs into a token error, the a new token gets retrieved, updated in the token 
cache and the edit should be retried. Agree @Xqt ?
  
  Most relevant code is in 
https://github.com/wikimedia/pywikibot/blob/master/pywikibot/site/__init__.py 
btw.

TASK DETAIL
  https://phabricator.wikimedia.org/T261050

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Multichill
Cc: matej_suchanek, daniel, Krinkle, eprodromou, Tgr, Dvorapa, Xqt, Aklapper, 
Reedy, pywikibot-bugs-list, Multichill, JohnsonLee01, SHEKH, Naike, Dijkstra, 
CBogen, Khutuck, Zkhalido, WDoranWMF, Viztor, DannyS712, Wenyi, Amorymeltzer, 
Ramsey-WMF, Tbscho, MayS, Sethakill, Mdupont, JJMC89, dg711, Poyekhali, 
Agabi10, Altostratus, Taiwania_Justo, Avicennasis, Pchelolo, Ixocactus, 
Wong128hk, mys_721tx, Bawolff, El_Grafo, Dinoguy1000, jayvdb, Anomie, Masti, 
Alchimista, Steinsplitter, Rxy, Keegan, Legoktm
___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs