I'm not familiar w/ pywikipedia =p, but the problem is at least about connection rather than python: the socket connection fails to be established at the beginning..