[Pywikipedia-bugs] [Maniphest] [Commented On] T305302: Provide tests for Lexeme classes

2023-02-04 Thread Ayush_Anand3310
Ayush_Anand3310 added a comment.


  I have to write these tests in wikibase_tests.py, right?

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

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

To: Ayush_Anand3310
Cc: Ayush_Anand3310, matej_suchanek, Aklapper, Xqt, pywikibot-bugs-list, 
PotsdamLamb, Jyoo1011, JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, 
Viztor, Wenyi, Tbscho, MayS, Framawiki, Mdupont, JJMC89, Dvorapa, Altostratus, 
Avicennasis, mys_721tx, jayvdb, Ricordisamoa, 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] T284577: Cannot login to private wiki using BotPassword

2023-02-04 Thread Nirvanchik
Nirvanchik added a comment.


  user-config.py, user-password.py are configured, wiki family class is 
generated.
  
  Pywikibot is a fresh master 33803553adc3f1afa0e950f20fa6756619cbb459 

  Some info about Wiki site:
  
"generator": "MediaWiki 1.39.1",
"phpversion": "8.2.1",
"phpsapi": "apache2handler",
"dbtype": "postgres",
"dbversion": "14.6 (Ubuntu 14.6-201-yandex.52665.7e82983c2c)",
  
  Wiki site is currently configured to allow reading, writing, and making API 
requests for logged in users only.
  
  When I run "python pwb.py login"  I have:
  
(.virtualenv) c:\work\wiki\bot\Python\git\core>python pwb.py login
WARNING: API error readapidenied: You need read permission to use this 
module.
ERROR: You have no API read permissions. Seems you are not logged in.
Logging in to znanierussia:ru as NirvanaPyBot@pywikibot
WARNING: API warning (main): Subscribe to the mediawiki-api-announce 
mailing list at 

 for notice of API deprecations and breaking changes.
WARNING: API warning (login): Fetching a token via "action=login" is 
deprecated. Use "action=query=tokens=login" instead.
ERROR: Received incorrect login token. Forcing re-login.
WARNING: API error readapidenied: You need read permission to use this 
module.
ERROR: You have no API read permissions. Seems you are not logged in.
ERROR: Username 'NirvanaPyBot@pywikibot' does not have read permissions on 
znanierussia:ru
Not logged in on znanierussia:ru.

Execution time: 0 seconds
  
  The bot does 
"mediawiki/api.php?action=query=siteinfo=namespaces|namespacealiases|general"
 request without beeing logged in and fails.
  If you visit in browser 
"https://my_site/mediawiki/api.php?action=query=siteinfo=namespaces|namespacealiases|general"
 and not logged in I get
  
{
"error": {
"code": "readapidenied",
"info": "You need read permission to use this module.",
"*": "See "
}
}
  
  If I login in browser It works OK.
  
  Running `python pwb.py login -v -debug` shows that the first request the bot 
is making is "query siteinfo":
  
2023-02-05 05:11:00   _requests.py,  672 in _get_request_params: DEBUG  
  API request to znanierussia:ru (uses get: True):
Headers: {'Content-Type': 'application/x-www-form-urlencoded'}
URI: 
'/mediawiki/api.php?action=query=siteinfo%7Cuserinfo=namespaces%7Cnamespacealiases%7Cgeneral==blockinfo%7Chasmsg=5=json'

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

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

To: Xqt, Nirvanchik
Cc: Nirvanchik, Xqt, Mpaa, Dvorapa, pywikibot-bugs-list, RhinosF1, Urbanecm, 
Aklapper, ChrisBlomTS, Themindcoder, Adamm71, 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, Tbscho, MayS, Framawiki, Lewizho99, Mdupont, 
JJMC89, Maathavan, 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] T284577: Cannot login to private wiki using BotPassword

2023-02-04 Thread Nirvanchik
Nirvanchik added a comment.


  I also suffer of this problem :(

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

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

To: Xqt, Nirvanchik
Cc: Nirvanchik, Xqt, Mpaa, Dvorapa, pywikibot-bugs-list, RhinosF1, Urbanecm, 
Aklapper, ChrisBlomTS, Themindcoder, Adamm71, 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, Tbscho, MayS, Framawiki, Lewizho99, Mdupont, 
JJMC89, Maathavan, 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


[pywikibot] Re: How to ignore all the non-visible stuff?

2023-02-04 Thread Bináris
from pywikibot.textlib import   removeDisabledParts
print(removeDisabledParts(text))

This makes something similar, but just the noinclude tag is not included.
Bot if you follow the source from
https://doc.wikimedia.org/pywikibot/master/api_ref/textlib.html#textlib.removeDisabledParts,
you can adapt it.
Alternatively, you could use re.sub().

Roy Smith  ezt írta (időpont: 2023. febr. 4., Szo, 20:34):

> [[:en:Template:Did you know/Queue/NextPrep]] contains:
>
> > 4 
> > {{documentation|content=This number indicates the next DYK prep set to
> move into the queue.}}
> > 
>
> What I want to get is just the "4".  Is Page.extract() what I'm looking
> for?  Experimentally, it does what I want, but it's not clear if this is
> actually the intended use case.
>
> ___
> pywikibot mailing list -- pywikibot@lists.wikimedia.org
> Public archives at
> https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/message/G5Z3TPTY3QFPZALSCVW7ZVTXJ7ZTZ5BC/
> To unsubscribe send an email to pywikibot-le...@lists.wikimedia.org
>


-- 
Bináris
___
pywikibot mailing list -- pywikibot@lists.wikimedia.org
Public archives at 
https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/message/4QLMCKCZX2LLZ5NHZRTDB3HONSYA56R4/
To unsubscribe send an email to pywikibot-le...@lists.wikimedia.org


[pywikibot] How to ignore all the non-visible stuff?

2023-02-04 Thread Roy Smith
[[:en:Template:Did you know/Queue/NextPrep]] contains:

> 4 
> {{documentation|content=This number indicates the next DYK prep set to move 
> into the queue.}}
> 

What I want to get is just the "4".  Is Page.extract() what I'm looking for?  
Experimentally, it does what I want, but it's not clear if this is actually the 
intended use case.

___
pywikibot mailing list -- pywikibot@lists.wikimedia.org
Public archives at 
https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/message/G5Z3TPTY3QFPZALSCVW7ZVTXJ7ZTZ5BC/
To unsubscribe send an email to pywikibot-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Created] T328846: pwb login -autocreate may not be working with OAuth credentials

2023-02-04 Thread MarcoAurelio
MarcoAurelio created this task.
MarcoAurelio added projects: Pywikibot, Pywikibot-login.py.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  **Steps to replicate the issue**
  
  My bot has a fully unified global account and uses OAuth to authenticate. 
Using the `-autocreate` flag on `login.py` doesn't seem to be able to create 
and attach a new local account to the global one:
  
$ pwb login -site:wikiquote:as -autocreate
WARNING: API error mwoauth-invalid-authorization-invalid-user: The 
authorization headers in your request are for a user that does not exist here
WARNING: API error mwoauth-invalid-authorization-invalid-user: The 
authorization headers in your request are for a user that does not exist here
ERROR: Failed OAuth authentication for wikiquote:as: The authorization 
headers in your request are for a user that does not exist here
Not logged in on wikiquote:as.
  
  According to {src PWBC:pywikibot/scripts/login.py} the `-autocreate` flag can 
be used to "auto-create an account using unified login when necessary." My bot 
does have a fully unified global account.
  
  My user-config.py file has
  
  - `usernames['wikiquote']['*'] = 'bot_name_here'`
  - `authenticate['*.wikiquote.org'] = ( ... )`
  
  **What happens?**:
  
  See trace above.
  
  **What should have happened instead?**:
  
  A new local account attached to the global one is created.
  
  **Software version**
  
  WMF Production.
  
  **Pywikibot info/version**
  
$ python3 pywikibot-core/pwb.py version
Pywikibot: [https] r-pywikibot-core (49a9316, g17787, 2023/02/02, 13:17:54, 
stable)
Release version: 8.0.0
setuptools version: 66.1.1
mwparserfromhell version: 0.6.4
wikitextparser version: n/a
requests version: 2.28.2
  cacerts: ***redacted***
certificate test: ok
Python: 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110]
  
  Thank you.

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

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

To: MarcoAurelio
Cc: Aklapper, pywikibot-bugs-list, MarcoAurelio, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Framawiki, 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] [Triaged] T328769: Enhance Pywikibot.Page with is_person method

2023-02-04 Thread Xqt
Xqt triaged this task as "Low" priority.

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

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

To: Xqt
Cc: Xqt, Aklapper, pywikibot-bugs-list, binbot, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Framawiki, 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] [Triaged] T328811: pywikibot.Claim method to recursively copy a claim

2023-02-04 Thread Xqt
Xqt triaged this task as "Low" priority.

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

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

To: Xqt
Cc: matej_suchanek, Aklapper, RPI2026F1, pywikibot-bugs-list, PotsdamLamb, 
Jyoo1011, JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, 
Tbscho, MayS, Framawiki, Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, 
mys_721tx, Xqt, jayvdb, Ricordisamoa, 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] T328814: Login retrieves token from incorrect location

2023-02-04 Thread Xqt
Xqt added a comment.


  > should be changed to:
  >
  >   login_request[
  >   self. Keyword('token')] = response['token']
  
  this proposal does not work because no token is given with the response:
  
{'code': 'badtoken',
 'info': 'Invalid CSRF token.',
 'other': {'help': 'See https://de.wikipedia.org/w/api.php for API usage. '
   'Subscribe to the mediawiki-api-announce mailing list at 
'
   
'https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/;
 '
   'for notice of API deprecations and breaking changes.',
   'servedby': 'mw1376'},
 'unicode': 'badtoken: Invalid CSRF token.\n'
'[servedby: mw1376;\n'
' help: See https://de.wikipedia.org/w/api.php for API usage. '
'Subscribe to the mediawiki-api-announce mailing list at '

'https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/;
 '
'for notice of API deprecations and breaking changes.]'}
  
  The currend code clears the token wallet in line 430. New tokens are loaded 
with Site.get_tokens() 

 when `self.site.tokens['login']` is used.
  
  @chiefgeek157: Could you give the complete I/O during login for further 
investigation please. (Please redact private data).

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

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

To: Xqt
Cc: Xqt, Aklapper, chiefgeek157, pywikibot-bugs-list, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Framawiki, Mdupont, JJMC89, TerraCodes, 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] T328814: Login retrieves token from incorrect location

2023-02-04 Thread Xqt
Xqt added projects: Pywikibot-login.py, TestMe.

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

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

To: Xqt
Cc: Aklapper, chiefgeek157, pywikibot-bugs-list, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Framawiki, Mdupont, JJMC89, TerraCodes, 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


[Pywikibot-commits] [Gerrit] ...core[master]: [feat] clean_sandbox: Configure script for some projects

2023-02-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/886411 )

Change subject: [feat] clean_sandbox: Configure script for some projects
..

[feat] clean_sandbox: Configure script for some projects

Configuration comes from what those projects currently use in their Sandoxes.

Change-Id: Ib0fa7dd47e030d232e7f0d4977676de4f2e852ce
---
M scripts/clean_sandbox.py
1 file changed, 39 insertions(+), 4 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/scripts/clean_sandbox.py b/scripts/clean_sandbox.py
index 286a477..b0a97b9 100755
--- a/scripts/clean_sandbox.py
+++ b/scripts/clean_sandbox.py
@@ -23,7 +23,7 @@
 -textfile  As an alternative to -text, you can use this to provide
a file containing the text to be used.

--summary   Summary of the edit made by bot. Overrides the default
+-summary   Summary of the edit made by the bot. Overrides the default
from i18n.

 This script is a :py:obj:`ConfigParserBot `.
@@ -61,19 +61,40 @@
 'commons': '{{Sandbox}}\n',
 'meta': '{{Meta:Sandbox/Please do not edit this line}}\n'
 '',
+'species': '{{Sandbox}}\n'
+   '',
 'test': '{{Sandbox}}\n'
 '== Please start your testing below this line ==',
 'wikidata': '{{Please leave this line alone (sandbox heading)}}',
 'wikibooks': {
+'es': '{{subst:ZDP/2}}',
 'ru': '{{/Шапка}}\n'
   '',
 },
-'wikivoyage': {
+'wikinews': {
+'es': '{{ZDP}}\n== Haz tus pruebas bajo esta sección  ==',
+},
+'wikiquote': {
+'es': '{{ZDP}}\n== Haz tus pruebas bajo esta sección  ==',
+},
+'wikisource': {
 'es': ''
   '{{Zona de pruebas}}'
-  '\n\n'
-  '== Las pruebas en esta sección ==\n',
+  '\n',
+},
+'wikiversity': {
+'es': '{{/encabezado}}\n'
+  '== Haz tus pruebas bajo esta sección  ==',
+},
+'wikivoyage': {
+'es': '{{Zona de pruebas}}'
+  '\n'
+  '== Haz tus pruebas bajo esta sección ==',
+},
+'wiktionary': {
+'es': '{{Titular-zdp}}'
+  '',
 },
 'als': '{{subst:/Vorlage}}',
 'ar': '{{عنوان الملعب}}\n',
+'es': '{{Titular-zdp}}'
+  '\n'
+  '== Las pruebas en esta sección ==\n',
 'eo': '{{Bonvolu ne forigi tiun ĉi linion (Provejo)}}',
 'fa': '{{subst:Wikipedia:ربات/sandbox}}',
 'fi': '{{subst:Hiekka}}',

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/886411
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ib0fa7dd47e030d232e7f0d4977676de4f2e852ce
Gerrit-Change-Number: 886411
Gerrit-PatchSet: 4
Gerrit-Owner: MarcoAurelio 
Gerrit-Reviewer: Xqt 
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
___
Pywikibot-commits mailing list -- pywikibot-commits@lists.wikimedia.org
To unsubscribe send an email to pywikibot-commits-le...@lists.wikimedia.org


[Pywikipedia-bugs] [Maniphest] [Closed] T219093: protect.py should provides option to choose level for protect

2023-02-04 Thread Xqt
Xqt closed this task as "Invalid".
Xqt added a comment.


  as noted above.

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

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

To: Xqt
Cc: Xqt, Ciencia_Al_Poder, Framawiki, Aklapper, Kizule, pywikibot-bugs-list, 
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] [Updated] T219093: protect.py should provides option to choose level for protect

2023-02-04 Thread Ciencia_Al_Poder
Ciencia_Al_Poder added a comment.


  I think this request is invalid because it already supports those parameters 
(they existed before the task was created, as they are mentioned in 
rPWBCac834c998a 

 from 2014)
  
-unprotectActs like "default:all"

-default: Sets the default protection level (default 'sysop'). If no
  level is defined it doesn't change unspecified levels.

-[type]:[level]   Set [type] protection level to [level]

Usual values for [level] are: sysop, autoconfirmed, all; further levels may 
be
provided by some wikis.

For all protection types (edit, move, etc.) it chooses the default 
protection
level. This is "sysop" or "all" if -unprotect was selected. If multiple
parameters -unprotect or -default are used, only the last occurrence
is applied.

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

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

To: Ciencia_Al_Poder
Cc: Ciencia_Al_Poder, Framawiki, Aklapper, Kizule, pywikibot-bugs-list, 
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