Revision: 7662 Author: alexsh Date: 2009-11-16 21:58:10 +0000 (Mon, 16 Nov 2009)
Log Message: ----------- Fix non-useragent forbidden for upload.wikimedia.org
Modified Paths: -------------- trunk/pywikipedia/upload.py
Modified: trunk/pywikipedia/upload.py =================================================================== --- trunk/pywikipedia/upload.py 2009-11-16 20:24:48 UTC (rev 7661) +++ trunk/pywikipedia/upload.py 2009-11-16 21:58:10 UTC (rev 7662) @@ -106,9 +106,12 @@
while not self._retrieved: uo = wikipedia.MyURLopener + headers = [('User-agent', wikipedia.useragent)] + if resume: wikipedia.output(u"Resume download...") - uo.addheader('Range', 'bytes=%s-' % rlen) + headers.append(('Range', 'bytes=%s-' % rlen)) + uo.addheaders = headers
file = uo.open(self.url)