[Pywikipedia-bugs] [Maniphest] [Closed] T344086: The WikidataBot.create_item_for_page() method doesn't return the ID of the created item, making it impossible to add claims to it

2023-08-13 Thread Vladis13
Vladis13 closed this task as "Resolved".

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

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

To: Vladis13
Cc: matej_suchanek, Aklapper, pywikibot-bugs-list, Vladis13, PotsdamLamb, 
Jyoo1011, JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, 
Tbscho, MayS, Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, 
Xqt, jayvdb, Masti, Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Commented On] T344086: The WikidataBot.create_item_for_page() method doesn't return the ID of the created item, making it impossible to add claims to it

2023-08-13 Thread Vladis13
Vladis13 added a comment.


  The bot made 4 new items, seems to work. I close the issue, reopen if the 
problem is not solved. Thanks for the answer.
  
  Maybe add a note about this argument to the method's declaration and/or 
`user_edit_entity()`?

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

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

To: Vladis13
Cc: matej_suchanek, Aklapper, pywikibot-bugs-list, Vladis13, PotsdamLamb, 
Jyoo1011, JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, 
Tbscho, MayS, Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, 
Xqt, jayvdb, Masti, Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Edited] T344086: The WikidataBot.create_item_for_page() method doesn't return the ID of the created item, making it impossible to add claims to it

2023-08-12 Thread Vladis13
Vladis13 updated the task description.

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

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

To: Vladis13
Cc: matej_suchanek, Aklapper, pywikibot-bugs-list, Vladis13, PotsdamLamb, 
Jyoo1011, JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, 
Tbscho, MayS, Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, 
Xqt, jayvdb, Masti, Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Commented On] T344086: The WikidataBot.create_item_for_page() method doesn't return the ID of the created item, making it impossible to add claims to it

2023-08-12 Thread Vladis13
Vladis13 added a comment.


  ID is not returned in about 20-30% of cases, as I noticed.

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

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

To: Vladis13
Cc: matej_suchanek, Aklapper, pywikibot-bugs-list, Vladis13, PotsdamLamb, 
Jyoo1011, JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, 
Tbscho, MayS, Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, 
Xqt, jayvdb, Masti, Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Edited] T344086: The WikidataBot.create_item_for_page() method doesn't return the ID of the created item, making it impossible to add claims to it

2023-08-12 Thread Vladis13
Vladis13 updated the task description.

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

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

To: Vladis13
Cc: matej_suchanek, Aklapper, pywikibot-bugs-list, Vladis13, PotsdamLamb, 
Jyoo1011, JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, 
Tbscho, MayS, Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, 
Xqt, jayvdb, Masti, Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Edited] T344086: The WikidataBot.create_item_for_page() method doesn't return the ID of the created item, making it impossible to add claims to it

2023-08-11 Thread Vladis13
Vladis13 updated the task description.

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

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

To: Vladis13
Cc: Aklapper, pywikibot-bugs-list, Vladis13, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, Xqt, jayvdb, 
Masti, Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Retitled] T344086: The WikidataBot.create_item_for_page() method doesn't return the ID of the created item, making it impossible to add claims to it

2023-08-11 Thread Vladis13
Vladis13 renamed this task from "The WikidataBot.create_item_for_page() method 
doesn't return the ID of the created item, which makes it impossible to add 
claims to it" to "The WikidataBot.create_item_for_page() method doesn't return 
the ID of the created item, making it impossible to add claims to it".

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

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

To: Vladis13
Cc: Aklapper, pywikibot-bugs-list, Vladis13, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, Xqt, jayvdb, 
Masti, Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Created] T344086: The WikidataBot.create_item_for_page() method doesn't return the ID of the created item, which makes it impossible to add claims to it

2023-08-11 Thread Vladis13
Vladis13 created this task.
Vladis13 added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  **What happens?**:
  My bot creates items for wikipages, then claims are added to them.
  
  The `WikidataBot.create_item_for_page()` method (`pywikibot/bot.py`) doesn't 
return the ID of the created item, that makes it impossible to add claims to 
it. 
  My bot has been working for several years, there was no such error before.
  
  **Other information**:
  This is the end of this method:
  
def create_item_for_page(self, page, data=None, summary=None, **kwargs):
# 
result = self.user_edit_entity(item, data, summary=summary, **kwargs)
if result:
return item
return None
  
  Here, when the element is created, `result` becomes `True`. But the element 
ID is not updated and remains equal to `-1`, this erroneous value is returned 
to the calling method. So attempting to add a claim by that id causes a bot 
error.
  
  My calling method:
  
def treat_page_and_item(self, page, item):
"""Treat page/item."""
# ...

item = self.create_item_for_page(page, data=data, callback=lambda _, 
exc: self._callback(page, exc))
if item:
self.add_claims(item, claims)
  
  I tried to add a dirty hack to the calling method: make 5 attempts, with a 
pause of 2 seconds, request a page element and its ID. But it doesn't help:
  
def treat_page_and_item(self, page, item):
"""Treat page/item."""
# ...

item = self.create_item_for_page(page, data=data, callback=lambda _, 
exc: self._callback(page, exc))
for _ in range(5):
if item.id == '-1':
try:
time.sleep(2)
item = page.data_item()
except:
continue
else:
self.add_claims(item, claims)
break
  
  The bot creates erroneous items without claims. The big problem now is to 
look for them in the bot's contributions to fix them. And I don't know how to 
fix the bot.
  https://www.wikidata.org/w/index.php?title=Q121334607=history
  https://www.wikidata.org/w/index.php?title=Q121356015=history
  https://www.wikidata.org/w/index.php?title=Q121356016=history
  https://www.wikidata.org/w/index.php?title=Q121356017=history
  https://www.wikidata.org/w/index.php?title=Q121356018=history
  https://www.wikidata.org/w/index.php?title=Q121356019=history
  
  My bot page: 
https://github.com/vladiscripts/ws_create_items_for_enc/blob/master/create_items_bot.py

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

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

To: Vladis13
Cc: Aklapper, pywikibot-bugs-list, Vladis13, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, Xqt, jayvdb, 
Masti, Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Commented On] T318239: scripts/category.py: Allow pagegenerators intersection with actions other than "add"

2022-09-25 Thread Vladis13
Vladis13 added a comment.


  I have done `git pull`.
  
> pwb.py -simulate category -site:wikisource:ru -cat:"ОУН-УПА" remove 
-from:"Украина"
ERROR: Unknown parameter "-cat:ОУН-УПА".
Use -help for further information.
  
  Also, a new bug appeared, the `-lang` argument broken:
  
> pwb.py category -site:wikisource -lang:ru -cat:"ОУН-УПА" remove 
-from:"Украина"  -simulate
Traceback (most recent call last):
  ...
  File "... /pwb/core/scripts/category.py", line 1469, in main
local_args = pywikibot.handle_args(args)
  File "... /pwb/core/pywikibot/bot.py", line 912, in handle_args
config.family, config.mylang = value.split(':')
ValueError: not enough values to unpack (expected 2, got 1)
CRITICAL: Exiting due to uncaught exception 
  
  In the commit (and in the title of this thread), you use the word 
"intersection" a lot. But the point is to support the basic `pagegenerators` 
options, which include "intersection" as well. It seems to me that you can 
simplify the descriptions in the commit.

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

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

To: Xqt, Vladis13
Cc: Xqt, Aklapper, pywikibot-bugs-list, Vladis13, Jersione, Hellket777, 
LisafBia6531, 786, Biggs657, PotsdamLamb, Jyoo1011, JohnsonLee01, Juan90264, 
SHEKH, Dijkstra, Alter-paule, Beast1978, Un1tY, Khutuck, Zkhalido, Hook696, 
Kent7301, joker88john, Viztor, CucyNoiD, Wenyi, Gaboe420, Giuliamocci, 
Cpaulf30, Af420, Bsandipan, Chicocvenancio, Tbscho, MayS, Lewizho99, Mdupont, 
JJMC89, Maathavan, Dvorapa, Altostratus, Neuronton, Avicennasis, mys_721tx, 
jayvdb, Masti, Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Commented On] T318239: scripts/category.py: Allow pagegenerators intersection with actions other than "add"

2022-09-21 Thread Vladis13
Vladis13 added a comment.


  How to remove pages from a category by generator? The only way is to use the 
`remove.py` script with the `-regex` argument?
  `pwb.py replace -family:wikisource -lang:ru -cat:"OUN-UPA" -regex 
'\[\[Category:Ukraine\]\]\n?' ''`

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

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

To: Vladis13
Cc: Xqt, Aklapper, pywikibot-bugs-list, Vladis13, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, jayvdb, Masti, 
Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Commented On] T318239: scripts/category.py: Allow pagegenerators intersection with actions other than "add"

2022-09-21 Thread Vladis13
Vladis13 added a comment.


  There is also confusion with the name of the argument. 
  The script (by page generator) execute for each page the `remove 
-from:category_name` command. In human terms, this means: remove this page from 
the categoryname category.
  But it turns out that it completely clears the category, removing all pages. 
Then this command should be called as "clear category". 
  But the script already has a `clean` command, which has no description. What 
it does? Is this a duplicate of `remove`?

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

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

To: Vladis13
Cc: Xqt, Aklapper, pywikibot-bugs-list, Vladis13, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, jayvdb, Masti, 
Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Commented On] T318239: scripts/category.py: Allow pagegenerators intersection with actions other than "add"

2022-09-21 Thread Vladis13
Vladis13 added a comment.


  Hm. The `category.py` help at 
https://doc.wikimedia.org/pywikibot/stable/scripts/main.html#module-scripts.category
 also says "This script supports use of pywikibot.pagegenerators arguments."

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

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

To: Vladis13
Cc: Xqt, Aklapper, pywikibot-bugs-list, Vladis13, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, jayvdb, Masti, 
Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Commented On] T318239: scripts/category.py: Problem with the page generator

2022-09-21 Thread Vladis13
Vladis13 added a comment.


  All of these scripts are based on `pywikibot.pagegenerators` and 
`pywikibot.bot`, and use common generator arguments.
  If this script is somehow strange, could you remove the list of generator 
commands from the script's help (`pwb.py category -help`) and from its page 
https://www.mediawiki.org/wiki/Manual:Pywikibot/category.py#Generators_and_filters_available
 ?

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

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

To: Vladis13
Cc: Xqt, Aklapper, pywikibot-bugs-list, Vladis13, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, jayvdb, Masti, 
Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Commented On] T318236: scripts/category.py: Bug of "-always" argument

2022-09-21 Thread Vladis13
Vladis13 added a comment.


  How to disable `-always` for other bulk edit commands?

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

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

To: Vladis13
Cc: Xqt, Aklapper, pywikibot-bugs-list, Vladis13, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, 
Chicocvenancio, Tbscho, MayS, Mdupont, JJMC89, Dvorapa, Altostratus, 
Avicennasis, mys_721tx, jayvdb, Masti, Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Updated] T318236: scripts/category.py: Bug of "-always" argument

2022-09-21 Thread Vladis13
Vladis13 added a comment.


  I use the `remove` command, examples are given here T318239 
<https://phabricator.wikimedia.org/T318239>.

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

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

To: Vladis13
Cc: Xqt, Aklapper, pywikibot-bugs-list, Vladis13, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, 
Chicocvenancio, Tbscho, MayS, Mdupont, JJMC89, Dvorapa, Altostratus, 
Avicennasis, mys_721tx, jayvdb, Masti, Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Edited] T318239: scripts/category.py: Problem with the page generator

2022-09-21 Thread Vladis13
Vladis13 updated the task description.

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

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

To: Vladis13
Cc: Aklapper, pywikibot-bugs-list, Vladis13, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, Xqt, jayvdb, 
Masti, Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Edited] T318239: scripts/category.py: Problem with the page generator

2022-09-21 Thread Vladis13
Vladis13 updated the task description.

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

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

To: Vladis13
Cc: Aklapper, pywikibot-bugs-list, Vladis13, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, Xqt, jayvdb, 
Masti, Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Created] T318239: scripts/category.py: Problem with the page generator

2022-09-21 Thread Vladis13
Vladis13 created this task.
Vladis13 added projects: Pywikibot, Pywikibot-Scripts.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  I want to remove a category from the intersection list of two other 
categories using the `-intersect` argument. (To remove duplicate pages in a 
supercategory.)
  
  If I run the `listpages` list with `-intersect` everything is correct, there 
are only 12 pages.
  `pwb.py listpages -family:wikisource -lang:ru -cat:"ОУН-УПА" -cat:"Украина" 
-intersect`
  
  But when I run the same with the `category` script, the script starts 
emptying the entire global category "Украина". But it should have been only 
from those 12 pages.
  `pwb.py category -family:wikisource -lang:ru -cat:"ОУН-УПА" -cat:"Украина" 
-intersect remove -from:"Украина"`.
  
  Note: The problem is more serious, because a bug was found with the `-always` 
parameter T318236 <https://phabricator.wikimedia.org/T318236>, so the bot 
empties the global category without question.

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

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

To: Vladis13
Cc: Aklapper, pywikibot-bugs-list, Vladis13, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, Xqt, jayvdb, 
Masti, Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Updated] T318236: scripts/category.py: Bug of "-always" argument

2022-09-21 Thread Vladis13
Vladis13 edited projects, added Pywikibot-category.py; removed 
Pywikibot-Scripts.

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

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

To: Vladis13
Cc: Aklapper, pywikibot-bugs-list, Vladis13, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, 
Chicocvenancio, Tbscho, MayS, Mdupont, JJMC89, Dvorapa, Altostratus, 
Avicennasis, mys_721tx, Xqt, jayvdb, Masti, Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Created] T318236: scripts/category.py: Bug of "-always" argument

2022-09-21 Thread Vladis13
Vladis13 created this task.
Vladis13 added projects: Pywikibot-Scripts, Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  I'm running the `category.py` script without the `-always` argument, so the 
bot should show the diff and ask if it needs to be edited. But the bot doesn't 
this, `always` don't disable, bot making wrong edits.
  
  There seems to be an error at line #1530:
  
elif option == 'always':
  options[option] = True
  
  Here T291757#7378248 <https://phabricator.wikimedia.org/T291757#7378248> 
`always` has been set to `always=True` as default, so it is always True.
  
  Perhaps this error remained in other scripts.

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

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

To: Vladis13
Cc: Aklapper, pywikibot-bugs-list, Vladis13, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, Xqt, jayvdb, 
Masti, Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Created] T307826: movepages.py: arguments recognition error

2022-05-06 Thread Vladis13
Vladis13 created this task.
Vladis13 added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  There is broken the `movepages.py` script, arguments recognition error. Since 
the 28 March commit (github 
<https://github.com/wikimedia/pywikibot/commit/68bc18c4acabc3c29ab33c83b63bef8ebc030b92>).
  
for arg in local_args:
opt, _, value = arg.partition(':')
if opt.startswith('-'):
continue
opt = opt[1:]
if opt == 'pairsfile':
  
  The line #200 `opt.startswith('-'): continue` ignores all arguments, because 
they must start with '-'.

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

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

To: Vladis13
Cc: Aklapper, pywikibot-bugs-list, Xqt, Vladis13, Jyoo1011, JohnsonLee01, 
SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, Mdupont, 
JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, jayvdb, Masti, Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Created] T291757: pagefromfile.py script: Problem of "-force" argument and user_confirm()

2021-09-25 Thread Vladis13
Vladis13 created this task.
Vladis13 added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  **What happens?**:
  My bot using the `pagefromfile.py` script has stopped working. The script 
asks for manual confirmation of page rewriting, which cannot be done because it 
works autonomously.
  
  Here's a command and a confirmation request. I hid a redundant ones with 
ellipsis, added the "-simulate" option.
  
pwb.py pagefromfile -file:wikisections.txt -begin:{{-start-}} 
-end:{{-end-}} -notitle "-summary:обновление списка" -family:wikipedia -lang:ru 
-user:TextworkerBot -force -simulate

Reading '.../wikisections.txt'...
Page ... already exists, ***overwriting!
Edit summary: ...
Do you want to accept these changes? ([y]es, [N]o, [a]ll, [q]uit): 
  
  **What should have happened instead?**:
  Previously, I just used the `-force` option.
  As far as I studied the code, confirmation requests are creating in 
`user_confirm()` at bot.py:1328. This is disabled only if the `-always` option 
is present.
  But pagefromfile.py does not handle the `-always` option in any way, so 
bot.py doesn't receive it. And it is not mentioned in the script help.
  
  So, the bot cannot work autonomously.
  
  **Software version (if not a Wikimedia wiki), browser information, 
screenshots, other information, etc**:
  Pwb 6.6.1

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

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

To: Vladis13
Cc: Aklapper, pywikibot-bugs-list, Vladis13, Jyoo1011, JohnsonLee01, SHEKH, 
Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, Mdupont, JJMC89, 
Dvorapa, Altostratus, Avicennasis, mys_721tx, jayvdb, Masti, Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Created] T285027: "add_text,py" error

2021-06-15 Thread Vladis13
Vladis13 created this task.
Vladis13 added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  Since June, the "add_text" script gives an error. My bot is broken.
  
pwb.py add_text -family:wikipedia -lang:ru -page:'4-Гидроксиэстрон' 
-text:"{{Нет полных библиографических описаний}}" 
-grepnot:"\{\{([Шш]аблон:)?([Рр]едактирую|[Ss]ubst:L|[Ii]n-?use(-by)?|[Pp]rocess(ing)?|[Пп]равлю|[Пп]еревожу|[Пп]ерерабатываю|[Сс]татья
 редактируется|[Вв]икифицирую)\s*[|}]" -simulate
  
  
  
0 pages read
0 pages written
0 pages skipped
Execution time: 0 seconds
Script terminated by exception:

ERROR: TypeError: super(type, obj): obj must be an instance or subtype of 
type
Traceback (most recent call last):
  File "/data/project/shared/pywikipedia/core/pwb.py", line 399, in 
if not main():
  File "/data/project/shared/pywikipedia/core/pwb.py", line 394, in main
module)
  File "/data/project/shared/pywikipedia/core/pwb.py", line 109, in 
run_python_file
main_mod.__dict__)
  File "/data/project/shared/pywikipedia/core/scripts/add_text.py", line 
444, in 
main()
  File "/data/project/shared/pywikipedia/core/scripts/add_text.py", line 
395, in main
bot.run()
  File 
"/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core/pywikibot/bot.py",
 line 1510, in run
if self.skip_page(page):
  File "/data/project/shared/pywikipedia/core/scripts/add_text.py", line 
340, in skip_page
if not page.isTalkPage() and ExistingPageBot.skip_page(self, page):
  File 
"/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core/pywikibot/bot.py",
 line 1840, in skip_page
return super().skip_page(page)
TypeError: super(type, obj): obj must be an instance or subtype of type
CRITICAL: Exiting due to uncaught exception 
  
  It started after, by May 1, the `-except` parameter was removed as 
deprecated, with a replacement for `-grepnot` (commit 1 
<https://github.com/wikimedia/pywikibot/commit/90779d30f35be366f7cdb780418c6dda9b9a3768>
 commit 2 
<https://github.com/wikimedia/pywikibot/commit/7ba533028b5f2403e42488481a3f73bb73f40f08>)
 and maybe something else.
  
  By the way, there were no notifications in the logs that the parameter was 
deprecated. As I see the `issue_deprecation_warning ()` method was used for the 
warning, maybe it doesn't work reliably?

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

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

To: Vladis13
Cc: Aklapper, pywikibot-bugs-list, Xqt, Diwanshu885, atagar, Vladis13, 
Jyoo1011, JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, 
Tbscho, MayS, Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, 
jayvdb, Masti, Alchimista
___
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Commented On] T279753: MySQL: AttributeError: 'Cursor' object has no attribute 'cursor

2021-04-09 Thread Vladis13
Vladis13 added a comment.


  Thanks you.

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

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

To: Xqt, Vladis13
Cc: JJMC89, Xqt, Aklapper, pywikibot-bugs-list, Vladis13, Jyoo1011, 
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
___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Commented On] T279753: MySQL: AttributeError: 'Cursor' object has no attribute 'cursor

2021-04-09 Thread Vladis13
Vladis13 added a comment.


  Was Pwb 3.0.dev0 (this version number did not change until this year for 
several years, although Pwb itself was regularly updated, probably it was a 
bug) → 6.0.1
  PyMySQL 0.9.3 → 1.0.2
  Python 3.7.

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

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

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


[Pywikipedia-bugs] [Maniphest] [Commented On] T279753: MySQL: AttributeError: 'Cursor' object has no attribute 'cursor

2021-04-08 Thread Vladis13
Vladis13 added a comment.


  I updated `pywikibot` and `pymysql` and it worked.
  I think, need to add check for the version of `pymysql` to 
`pywikibot/data/mysql.py`, and revert the code for support version <1.0.0. Or 
at least a notification that bots developers need to update `pymysql`.

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

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

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


[Pywikipedia-bugs] [Maniphest] [Created] T279753: MySQL: AttributeError: 'Cursor' object has no attribute 'cursor

2021-04-08 Thread Vladis13
Vladis13 created this task.
Vladis13 added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  The database queries in my bots, based on Pywikibot, crashes after the March 
changes (renamed the database replica 
<https://wikitech.wikimedia.org/w/index.php?title=Help:Toolforge/Database=1905017=1903282>
 T278252 <https://phabricator.wikimedia.org/T278252> and a few changes in 
Pywikibot like 
<https://github.com/wikimedia/pywikibot/commit/6a52075597c93f6720cff0401214778aa2a2625f>).
  From my PC (via SSH tunnel 
<https://wikitech.wikimedia.org/wiki/Help:Toolforge/Database#Connecting_to_the_database_replicas_from_your_own_computer>)
 scripts work, but not on toolforge.org server.
  
  To example, I run `python` promt on the server:
  
>>> from pywikibot.data import mysql

>>> sql = "SELECT * FROM page LIMIT 10;"
>>> result = mysql.mysql_query(sql, dbname='ruwiki')
>>> list(result)

Traceback (most recent call last):
  File "", line 1, in 
  File "/data/project/shared/pywikipedia/core/pywikibot/data/mysql.py", 
line 67, in mysql_query
with connection as conn, conn.cursor() as cursor:
AttributeError: 'Cursor' object has no attribute 'cursor'
  
  
  
>>> from pywikibot import config2 as config

>>> config.db_hostname_format.format(dbname)
'ruwiki.web.db.svc.wikimedia.cloud'

>>> config.db_name_format.format(dbname)
'ruwiki_p'

>>> config.db_port
3306

>>> credentials
{'read_default_file': '/data/project/vltools/replica.my.cnf'}

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

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

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


[Pywikipedia-bugs] [Maniphest] [Edited] T274723: TypeError: mime param in api.Request() must not be boolean

2021-02-13 Thread Vladis13
Vladis13 updated the task description.

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

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

To: Vladis13
Cc: Aklapper, pywikibot-bugs-list, Vladis13, Jyoo1011, JohnsonLee01, SHEKH, 
Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, Mdupont, JJMC89, 
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] T274723: TypeError: mime param in api.Request() must not be boolean

2021-02-13 Thread Vladis13
Vladis13 created this task.
Vladis13 added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  This error raise when I trying use the upload.py 
<https://www.mediawiki.org/wiki/Manual:Pywikibot/upload.py> script with the 
parameter `-chunked`.
  
Uploading file to commons:commons...
ERROR: Upload error: 
Traceback (most recent call last):
  File "/home/vladislav/usr/pwb/core/pywikibot/specialbots/_upload.py", 
line 395, in upload_file
success = imagepage.upload(file_url,
  File "/home/vladislav/usr/pwb/core/pywikibot/page/__init__.py", line 
2450, in upload
return self.site.upload(self, source_filename=filename, source_url=url,
  File "/home/vladislav/usr/pwb/core/pywikibot/tools/__init__.py", line 
1479, in wrapper
return obj(*__args, **__kw)
  File "/home/vladislav/usr/pwb/core/pywikibot/site/_decorators.py", line 
93, in callee
return fn(self, *args, **kwargs)
  File "/home/vladislav/usr/pwb/core/pywikibot/site/_apisite.py", line 
4501, in upload
req = self._request(
  File "/home/vladislav/usr/pwb/core/pywikibot/site/_apisite.py", line 287, 
in _request
return self._request_class(kwargs)(site=self, **kwargs)
  File "/home/vladislav/usr/pwb/core/pywikibot/data/api.py", line 1029, in 
__init__
raise TypeError('mime param in api.Request() must not be boolean')
TypeError: mime param in api.Request() must not be boolean
  
  As far as I see, cause of the error is the `mime=True`instead `mime={}` or 
something kind in pywikibot/site/_apisite.py, line #4501, `req = self._request( 
throttle=throttle, mime=True`.  
  It call pywikibot/data/api.py → `class Request(MutableMapping)` that have  
`def __init__(self, site=None, mime: Optional[dict] = None`, it's type 
annotation `dict`.
  This `mime` and `self.mime` using only in `def _build_mime_request(cls, 
params: dict, mime_params: dict)` as `mime_params` that also annotated as 
`dict`.
  
  Although I don't understand why is broken `chunked` parameter of that script.

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

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

To: Vladis13
Cc: Aklapper, pywikibot-bugs-list, Vladis13, Jyoo1011, JohnsonLee01, SHEKH, 
Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, Mdupont, JJMC89, 
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] T248372: Critical exceptionl: local variable 'relative_filename' referenced before assignment

2020-03-24 Thread Vladis13
Vladis13 renamed this task from "Critica exceptionl: local variable 
'relative_filename' referenced before assignment" to "Critical exceptionl: 
local variable 'relative_filename' referenced before assignment".

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

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

To: Vladis13
Cc: Xqt, Aklapper, pywikibot-bugs-list, Vladis13, Zkhalido, Viztor, Wenyi, 
Tbscho, MayS, Mdupont, JJMC89, 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] T248372: Critica exceptionl: local variable 'relative_filename' referenced before assignment

2020-03-24 Thread Vladis13
Vladis13 created this task.
Vladis13 added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  A my bot on wmftools falls with follows exception. Since this commit 
<https://phabricator.wikimedia.org/rPWBC00fcf1359db7bd14f01378f128e9d5e1771b92f8>
  March 9, I think.
  
Traceback (most recent call last):
  File "/data/project/shared/pywikipedia/core/pwb.py", line 368, in 
if not main():
  File "/data/project/shared/pywikipedia/core/pwb.py", line 362, in main
[Path(relative_filename).stem] + argvu[1:],
UnboundLocalError: local variable 'relative_filename' referenced before 
assignment
CRITICAL: Exiting due to uncaught exception 

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

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

To: Vladis13
Cc: Xqt, Aklapper, pywikibot-bugs-list, Vladis13, Zkhalido, Viztor, Wenyi, 
Tbscho, MayS, Mdupont, JJMC89, 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] [Edited] T246298: Ability to change a label name for new Wikidata items in Pywikibot

2020-02-28 Thread Vladis13
Vladis13 updated the task description.

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

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

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


[Pywikipedia-bugs] [Maniphest] [Created] T246298: Ability to change a label name for new Wikidata items in Pywikibot

2020-02-26 Thread Vladis13
Vladis13 created this task.
Vladis13 added projects: Pywikibot-Wikidata, Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  Pywikibot creates a page items with a label equivalent to the page name. See 
pywikibot.bot.create_item_for_page() 
<https://phabricator.wikimedia.org/diffusion/PWBC/browse/master/pywikibot/bot.py>.
  Could you add the ability to set another label via the `data` parameter?
  
  Because on Wikisource all encyclopedia pages have prefixes and suffixes 
(Q24509724 <https://www.wikidata.org/wiki/Q24509724>, Q21281526 
<https://www.wikidata.org/wiki/Q21281526>, etc.). And traditionally labels for 
them are created with spaces around slashes separating prefixes and suffixes, 
the bot don't make it (example Q85899318 
<https://www.wikidata.org/wiki/Q85899318>). 
  Moreover, the consensus about naming is not clear, because according the 
proposed rule of Wikidata 
<https://www.wikidata.org/wiki/Help:Label#Wikimedia_page_title_may_give_orientation>
 the names of items should be named equivalent to the article’s own name. 
Currently, this method remove a disambiguation information only from brackets 
in page name. But don't know nothing about such prefixes and suffix, which 
usually are a mark of disambiguation information about the orphography/edition 
of page.

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

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

To: Vladis13
Cc: Aklapper, pywikibot-bugs-list, Vladis13, Zkhalido, Viztor, Wenyi, Tbscho, 
MayS, Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, jayvdb, 
Ricordisamoa, 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] T142155: Bot can't login. keyError in GetCookie

2016-11-08 Thread Vladis13
Vladis13 added a comment.
@Tgr yes, on https://www.mediawiki.org/wiki/Manual:Pywikibot/Installation again was not updated version number 2.0rc4. So I thought that my version Pwb is actual.

I make Oauth, but Pwb still ask password.  I tried make Oauth from both accounts - user and bot, then write string in config, according manual, like: 
authenticate['*.wikipedia.org'] = ('1920cc7b7.','2be514c9', 'd7cb99b0.','6dd4a2206171..').

Note that in https://www.mediawiki.org/wiki/Manual:Pywikibot/login.py#Login_using_OAuth write Run python login.py -oauth, but that command not work.

Also, I tried BotPassword. I write in passwords.txt like:
("Accounname", BotPassword("Accounname", "sl2298i"))
But it make the error:

Traceback (most recent call last):
  File "pwb.py", line 270, in 
if not main():
  File "pwb.py", line 264, in main
run_python_file(filename, [filename] + args, argvu, file_package)
  File "pwb.py", line 109, in run_python_file
main_mod.__dict__)
  File ".\scripts\login.py", line 129, in 
main()
  File ".\scripts\login.py", line 114, in main
site.login(sysop)
  File "C:\pwb\pywikibot\site.py", line 1683, in login
user=self._username[sysop])
  File "C:\pwb\pywikibot\tools\__init__.py", line 1105, in wrapper
return obj(*__args, **__kw)
  File "C:\pwb\pywikibot\login.py", line 106, in __init__
self.readPassword()
  File "C:\pwb\pywikibot\login.py", line 195, in readPassword
entry = eval(line)
  File "", line 1, in 
NameError: name 'BotPassword' is not defined

CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abortTASK DETAILhttps://phabricator.wikimedia.org/T142155EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Legoktm, Vladis13Cc: Vladis13, Gallicbot, Krinkle, MZMcBride, Jay8g, revi, Paladox, Aschroet, zhuyifei1999, Stashbot, gerritbot, DrTrigon, Betacommand, Lokal_Profil, Tgr, Legoktm, JJMC89, Yamaha5, jayvdb, Ladsgroup, Xqt, valhallasw, Multichill, Anomie, CodeCat, TerraCodes, Luke081515, He7d3r, Basilicofresco, Jagwar, MarcoAurelio, Dalba, Aklapper, Joutbis, pywikibot-bugs-list, MayS, Mdupont, Alchimista, Rxy___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Commented On] T142155: Bot can't login. keyError in GetCookie

2016-11-01 Thread Vladis13
Vladis13 added a comment.
Work nothing: login, Oauth, Botpassword. :(
I don't understand, there the common login has broken at past week and it temporary bug? Or it forever, now only Oauth, which dont work?TASK DETAILhttps://phabricator.wikimedia.org/T142155EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Legoktm, Vladis13Cc: Vladis13, Gallicbot, Krinkle, MZMcBride, Jay8g, revi, Paladox, Aschroet, zhuyifei1999, Stashbot, gerritbot, DrTrigon, Betacommand, Lokal_Profil, Tgr, Legoktm, JJMC89, Yamaha5, jayvdb, Ladsgroup, Xqt, valhallasw, Multichill, Anomie, CodeCat, TerraCodes, Luke081515, He7d3r, Basilicofresco, Jagwar, MarcoAurelio, Dalba, Aklapper, Joutbis, pywikibot-bugs-list, MayS, Mdupont, Alchimista, Rxy___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Commented On] T142021: Error mysqlquery

2016-08-07 Thread Vladis13
Vladis13 added a comment.

In T142021#2528747, @Mpaa wrote:
mpaa@tools-bastion-03:~/core$ cat file.txt


Thanks. But I just wrote the little script on php: http://tools.wmflabs.org/ruwikisource/WDBquery_transcludes_templatesTASK DETAILhttps://phabricator.wikimedia.org/T142021EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Vladis13Cc: Mpaa, valhallasw, Aklapper, pywikibot-bugs-list, Vladis13, Mdupont, JJMC89, jayvdb___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Commented On] T142021: Error mysqlquery

2016-08-07 Thread Vladis13
Vladis13 added a comment.

In T142021#2528739, @Mpaa wrote:
You got your query wrong.

mpaa@tools-bastion-03:~/core$ python scripts/listpages.py -mysqlquery:"SELECT page_namespace, page_title FROM page WHERE page_namespace = 0 LIMIT 10"


You run it from user-home directory, I installed configs of pwb in my user-home and it there works too. But me need run it from scripts in tool-home directory. In documentation Help:Tool_Labs/Developing#Setup Pwb the items 4-5 write that user-config.py should create in tools.tool@tools-login, same writen in User:Russell Blau/Using pywikibot on Labs.TASK DETAILhttps://phabricator.wikimedia.org/T142021EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Vladis13Cc: Mpaa, valhallasw, Aklapper, pywikibot-bugs-list, Vladis13, Mdupont, JJMC89, jayvdb___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Commented On] T142021: Error mysqlquery

2016-08-04 Thread Vladis13
Vladis13 added a comment.
I repoted to Qursql. But I doubt that there will be repaired and ever be answered. 
Problem of Pwb is that the error is now, and no way works with MySQL, and old info in documentation.

Also, "python scripts\listpages.py" does not write a list of pages in file. And, redirect output in file on Windows does not work (like "python scripts \ listpages.py -transcludes:"template_name"> list.txt" or "... | more > list.txt"). It gives error of python, as if ">" is argument of its call.TASK DETAILhttps://phabricator.wikimedia.org/T142021EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Vladis13Cc: Mpaa, valhallasw, Aklapper, pywikibot-bugs-list, Vladis13, Mdupont, jayvdb___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Commented On] T142021: Error mysqlquery

2016-08-03 Thread Vladis13
Vladis13 added a comment.
I wanted list pages that transcludes a template, for use in an autonomous script. 
Now command "python scripts\listpages.py -transcludes" seems works. Perhaps something reinstalled at tries above. 
I will try get the list by call "import os ; os.system(command)", although I wanted using function of pwb-framework.TASK DETAILhttps://phabricator.wikimedia.org/T142021EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Vladis13Cc: Mpaa, valhallasw, Aklapper, pywikibot-bugs-list, Vladis13, Mdupont, jayvdb___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Commented On] T142021: Error mysqlquery

2016-08-03 Thread Vladis13
Vladis13 added a comment.
Turns out, oursql has a branch for Python 3. But

pip install oursql3

give error too: "utf-8' codec can't decode byte 0xcd in position 20: invalid continuation byte".TASK DETAILhttps://phabricator.wikimedia.org/T142021EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Vladis13Cc: Mpaa, valhallasw, Aklapper, pywikibot-bugs-list, Vladis13, Mdupont, jayvdb___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Commented On] T142021: Error mysqlquery

2016-08-03 Thread Vladis13
Vladis13 added a comment.

"pip install oursql" occurs errors too.  Oursql is critical outdated from 2012. On install it breaks on old format command "print " and something problem with Visual Studio. Also it require install "cython".
"pip install python-mysql" occurs error:


Could not find a version that satisfies the requirement python-mysql (from versions: )
No matching distribution found for python-mysql


I tried other mysql-connectors,
User:Legoktm/wmflib that recommend on Help:Tool Labs/Database is only for python 2.
All commons mysql-connectors  for python old versions too.
Official MySQL is max for python 3.4.



I tried just connect to DB-replica with edited the script User:Legoktm/wmflib, but Tool Labs require SSH connect. The script get only 1 host/user/password, but need connect with SSH-server, then with DB. I don't understand how do it.TASK DETAILhttps://phabricator.wikimedia.org/T142021EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Vladis13Cc: valhallasw, Aklapper, pywikibot-bugs-list, Vladis13, Mdupont, jayvdb___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Edited] T142021: Error mysqlquery

2016-08-03 Thread Vladis13
Vladis13 edited the task description. (Show Details)
EDIT DETAILS...E.g.  //python scripts\listpages.py -mysqlquery:"py -mysqlquery:"SELECT * FROM page LIMIT 10"//
or //list = pywikibot.pagegenerators.MySQLPageGenerator('SELECT * FROM page LIMIT 10"10')//...TASK DETAILhttps://phabricator.wikimedia.org/T142021EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Vladis13Cc: Aklapper, pywikibot-bugs-list, Vladis13, Mdupont, jayvdb___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Created] T142021: Error mysqlquery

2016-08-03 Thread Vladis13
Vladis13 created this task.Vladis13 added a project: Pywikibot-core.Herald added subscribers: pywikibot-bugs-list, Aklapper.
TASK DESCRIPTIONWhen run listpages.py -mysqlquery (or call function pagegenerators.py) occurs error that not found modules "oursql" and "MySQLdb". These files no in pwb and python packages.

E.g.  python scripts\listpages.py -mysqlquery:"SELECT * FROM page LIMIT 10"

Traceback (most recent call last):
  File "c:\python35\lib\site-packages\pywikibot-2.0rc3-py3.5.egg\pywikibot\pagegenerators.py", line 2210, in MySQLPageGenerator
import oursql as mysqldb
ImportError: No module named 'oursql'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
...
  File "c:\python35\lib\site-packages\pywikibot-2.0rc3-py3.5.egg\pywikibot\pagegenerators.py", line 2212, in MySQLPageGenerator
import MySQLdb as mysqldb
ImportError: No module named 'MySQLdb'
TASK DETAILhttps://phabricator.wikimedia.org/T142021EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Vladis13Cc: Aklapper, pywikibot-bugs-list, Vladis13, Mdupont, jayvdb___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Created] T132273: Error generate_user_files.py - version of Windows 10

2016-04-09 Thread Vladis13
Vladis13 created this task.
Herald added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  Does not run generate_user_files.py on Windows 10
  
File "C:\pwb\pywikibot\config2.py", line 278, in get_base_dir
% win_version)
OSError: Windows version 1 not supported yet.

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

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

To: Vladis13
Cc: Aklapper, pywikibot-bugs-list, Vladis13, codynguyen1116, jayvdb



___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Commented On] T112130: Pywikibot crashes on items with quantities with units. Need to implement unit support in pywikibot WbQuanity

2016-04-07 Thread Vladis13
Vladis13 added a comment.


  i dont

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

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

To: Vladis13
Cc: Vladis13, ArthurPSmith, zhuyifei1999, jayvdb, Ladsgroup, gerritbot, 
Aklapper, pywikibot-bugs-list, Multichill, Lewizho99, D3r1ck01, Izno, 
Wikidata-bugs, aude, Ricordisamoa, Mbch331



___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Commented On] T112130: Pywikibot crashes on items with quantities with units. Need to implement unit support in pywikibot WbQuanity

2016-04-06 Thread Vladis13
Vladis13 added a comment.


  In https://phabricator.wikimedia.org/T112130#2184242, @Vladis13 wrote:
  
  >
  
  
  This error was on old version 
<https://www.wikidata.org/w/index.php?title=Q4115189=319286502=319259767>
 item "Wikidata:Sandbox <https://www.wikidata.org/wiki/Q4115189>". After did 
remove all claims from it the error disappeared. Thus, some a claim can do the 
error.

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

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

To: Vladis13
Cc: Vladis13, ArthurPSmith, zhuyifei1999, jayvdb, Ladsgroup, gerritbot, 
Aklapper, pywikibot-bugs-list, Multichill, Lewizho99, D3r1ck01, Izno, 
Wikidata-bugs, aude, Ricordisamoa, Mbch331



___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs


[Pywikipedia-bugs] [Maniphest] [Commented On] T112130: Pywikibot crashes on items with quantities with units. Need to implement unit support in pywikibot WbQuanity

2016-04-06 Thread Vladis13
Vladis13 added a comment.


  I get the error when try run "Example 9: Add a source 
<https://www.wikidata.org/wiki/Wikidata:Creating_a_bot#Example_9:_Add_a_source>"
 from manual "Wikidata:Creating a bot".
  
import pywikibot
repo = pywikibot.Site("wikidata", "wikidata").data_repository()
item = pywikibot.ItemPage(repo, u"Q4115189")
item.get()

statedin = pywikibot.Claim(repo, u'P248')
itis = pywikibot.ItemPage(repo, "Q82575")
statedin.setTarget(itis)

retrieved = pywikibot.Claim(repo, u'P813')
date = pywikibot.WbTime(year=2014, month=3, day=20)
retrieved.setTarget(date)

claim.addSources([statedin, retrieved])

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

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

To: Vladis13
Cc: Vladis13, ArthurPSmith, zhuyifei1999, jayvdb, Ladsgroup, gerritbot, 
Aklapper, pywikibot-bugs-list, Multichill, Lewizho99, D3r1ck01, Izno, 
Wikidata-bugs, aude, Ricordisamoa, Mbch331



___
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs