Nirvanchik added a comment.

  user-config.py, user-password.py are configured, wiki family class is 
generated.
  
  Pywikibot is a fresh master 33803553adc3f1afa0e950f20fa6756619cbb459 
<https://phabricator.wikimedia.org/rPWBC33803553adc3f1afa0e950f20fa6756619cbb459>
  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 
<https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/>
 for notice of API deprecations and breaking changes.
    WARNING: API warning (login): Fetching a token via "action=login" is 
deprecated. Use "action=query&meta=tokens&type=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&meta=siteinfo&siprop=namespaces|namespacealiases|general"
 request without beeing logged in and fails.
  If you visit in browser 
"https://my_site/mediawiki/api.php?action=query&meta=siteinfo&siprop=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&meta=siteinfo%7Cuserinfo&siprop=namespaces%7Cnamespacealiases%7Cgeneral&continue=&uiprop=blockinfo%7Chasmsg&maxlag=5&format=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

Reply via email to