[Pywikipedia-l] Eternal login loop solution

Morten Wang nettrom at gmail.com
Fri Apr 9 15:31:58 UTC 2010


Hi all,

I've been struggling with the same problem Hannes Röst posted about
yesterday, that login.py (r8064) got stuck in the while True-loop on
line 170.

After reading MediaWiki bug 23076[1] closely, I noticed it referred to
a cookie, and debugging showed that the initial login request returns
a set-Cookie-header that is quietly ignored. From what I can tell the
if-statement in line 4979 of wikipedia.py (r8036) fails (because I
don't have any cookies at this point), and thus the cookies sent from
the server never get stored.  Commenting out the line so
self.updateCookies(...) is always called fixes the login problem.

I'd appreciate if a developer could look into this and figure out the
proper solution to the problem as I'm unsure whether the if-statement
can safely be removed.



Regards,
Morten

References:
1: https://bugzilla.wikimedia.org/show_bug.cgi?id=23076



More information about the Pywikipedia-l mailing list