Bugs item #3538008, was opened at 2012-06-25 21:52 Message generated for change (Tracker Item Submitted) made by jaclayiii You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3538008...
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: James (jaclayiii) Assigned to: Nobody/Anonymous (nobody) Summary: *-login.data can have case discrepency on Linux host
Initial Comment: Pywikipedia [http] trunk/pywikipedia (r10401, 2012/06/21, 06:18:43) Python 2.7.2+ (default, Oct 4 2011, 20:06:09) [GCC 4.6.1] config-settings: use_api = True use_api_login = True unicode test: ok
Summary: the *-login.data file maybe saved with an uppercase username but when load cookies tries to find it on a Linux host, the case of the username maybe lower. This has the unintended consequence of not allowing bots to login on private wikis that have anonymous read api rights disabled.
If a user connects to a wiki that has LDAP or some other form of "add-on" authentication, the user name returned may vary in case from what is in the user-config.py file. The reason this matters is that the <wikifamily>-<language>-<username>-login.data file may be saved with an upper case letter in the username. Thus if the user-config.py file contained:
users["mywiki"]["en"]="james"
but the LDAP authenticator returned back "James" as the username, then the *-login.data file would be mywiki-en-James-login.data, but when _loadcookies goes to look for such a file on line 5572:
if os.path.exists(localPA)
localPA is /~some/path/to/mywiki-en-james-login.data
Notice that the James is now lower case in the file above.
As Linux is case sensitive, it cannot find the login data and thus prevents access to wikis the do not allow anonymous access to api's. A temporary work around requires setting user name to the appropriate case (even if the username is case insensitive in the LDAP authentication scheme), for example:
users["mywiki"]["en"]="James"
keywords: SSL, Login failure, https login failure, https linux login, https pywikipedia, https pywikipedia linux
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3538008...
pywikipedia-bugs@lists.wikimedia.org