2009/12/16 ObsessiveMathsFreak obsessivemathsfreak@obsessivemathsfreak.org:
I found the problem. It was a problem with python socket library. Apparently the socket wasn't being buffered properly, or at least that's my understanding.
The problem was in the socket.py library, found in Ubuntu 9.10 under /usr/lib/python2.6/socket.py
At around line 500, replace this line for res in getaddrinfo(host, port, 0, SOCK_STREAM): with this on for res in getaddrinfo(host, port, AF_INET, SOCK_STREAM):
Apparently now the socket will be properly buffered. With the old line, wiki login took about 90 seconds for me. Now it takes less than a second.
Hope that helps someone else.
While it might be interesting for some pywikipedia users, I think that this error should be reported upstream. Can you please do it, explaining more thoroughly what the problem was and how you diagnosed it?