We run a private wiki, requiring logins to read. Pywikibot worked fine in 
MediaWiki 1.26, but since upgrading to MediaWiki 1.27.1, pywikbot now cannot 
log in. Any debugging help appreciated! The symptom is:

   $ pwb.py login.py
   ERROR: APIError: readapidenied: You need read permission to use this module
   Password for user Danb on examplewiki:en (no characters will be shown): 
********
   Logging in to examplewiki:en as Danb
   WARNING: API warning (login): Fetching a token via action=login is 
deprecated. Use action=query&meta=tokens&type=login instead.
   ERROR: Login failed (Failed).

My family file DOES contains an isPublic method that returns False, as 
instructed for private wikis at 
https://www.mediawiki.org/wiki/Manual:Pywikibot/Use_on_third-party_wikis#Bot_.26_private_wikis.
 

Also, authentication is by LDAP (using extension LdapAuthentication from 
mediawiki.org) and requires username, password, and domain. This worked fine 
for Pywikibot in MW 1.26.

I tried generating a new family file, and that failed too:

   $ ./generate_family_file.py https://examplewiki.net/wiki/Home examplewiki
   Generating family file from https://examplewiki.net/wiki/Home
   Traceback (most recent call last):
     File "./generate_family_file.py", line 321, in <module>
       FamilyFileGenerator(*sys.argv[1:]).run()
     File "./generate_family_file.py", line 94, in run
       w = Wiki(self.base_url)
     File "./generate_family_file.py", line 262, in __init__
       self._parse_post_117(wp, fromurl)
     File "./generate_family_file.py", line 293, in _parse_post_117
       info = json.loads(data.read().decode(data.charset))['query']['general']
   KeyError: u'query'

Here is the Pywikibot version info:

   $ pwb.py version.py
   Pywikibot: [https] r-pywikibot-core (fd4707e, g5894, 2016/12/05, 19:10:45, 
n/a)
   Release version: 2.0rc5
   httplib2 version: 0.9
     cacerts: 
/home/danb/pywikibot/externals/httplib2/python2/httplib2/cacerts.txt
       certificate test: ok
   Python: 2.7.12 (default, Jul  1 2016, 15:12:24) 
   [GCC 5.4.0 20160609]
     unicode test: ok
   PYWIKIBOT2_DIR: Not set
   PYWIKIBOT2_DIR_PWB: /home/danb/pywikibot
   PYWIKIBOT2_NO_USER_CONFIG: Not set
   Config base dir: /home/danb/pywikibot
   Usernames for family "examplewiki":
           en: danb (also sysop)

Thanks again,
DanB


_______________________________________________
pywikibot mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot

Reply via email to