Share

Python Wikipedia Robot Framework

Tracker: Bugs

9 upload.py problem - ID: 2889946
Last Update: Comment added ( rubin16 )

Imagecopy stops working:

C:\pt>imagecopy.py -cat:???????????:?_????????_??_?????????
Getting [[?????????:???????????:? ???????? ?? ?????????]]...
Getting 60 pages from wikipedia:ru...
Getting 1 pages from wikipedia:ru...
username=&doit=Uitvoeren&ignorewarnings=1&commonsense=1&language=ru&newname
=A.sc
hweizer.JPG&image=A.schweizer.JPG&project=wikipedia&remove_categories=1
Got CH desc.

{{Information
|Description={{ru|??????? ???????? ????? ???????????? ?????????? ????????,
?????
?????? [[:ru:???????, ???????|?. ????????]], 70 ?????????, 1973 ???.<br/>
== ?????????????? ==

[[:ru:?????????:???????????:???????? ???????? ?????|]]}}
|Source=Transferred from [http://ru.wikipedia.org ru.wikipedia]<br/>
(Original text : ''??????????? ????????? [[:ru:????????:????????? ?.
?????|?????
???? ?. ?????]]'')
|Date=1980 ???; ????????? {{Date|2009|10|28}}<br/>
({{Date|2009|10|28}} (original upload date))
|Author=[[:ru:Deutsche Post|????? ???]].
Original uploader was [[:ru:User:????????? ?. ?????|????????? ?. ?????]] at
[htt
p://ru.wikipedia.org ru.wikipedia]
|Permission=PD-BECAUSE.
|other_versions=
}}

== {{int:license}} ==
{{PD-because|[[:ru:commons:Template:PD-Deutsche Bundespost stamps|]]}}
<!-- Templates "Template:????????? ?? ?????????" were used in the original
descr
iption page as well , but do not appear to exist on commons. -->

== Original upload log ==
The original description page is/was
[http://ru.wikipedia.org/w/index.php?title=
Image%3AA.schweizer.JPG here]. All following user names refer to
ru.wikipedia.
* 2009-10-28 16:37 [[:ru:User:????????? ?. ?????|????????? ?. ?????]]
356?208? (
19588 bytes) ''<nowiki>{{??????????? | ???????? = ???????? ????? |
???????
? = ??????????? ????????? | ????? ???????? = 1973 | ????? =
?????
??? }}</nowiki>''
__NOTOC__

{{subst:Unc}} <!-- Remove this line once you have added categories -->
Getting 1 pages from wikipedia:ru...
Reading file http://upload.wikimedia.org/wikipedia/ru/9/93/A.schweizer.JPG
The suggested description is:


{{BotMoveToCommons|ru.wikipedia|year={{subst:CURRENTYEAR}}|month={{subst:CU
RRENT
MONTHNAME}}|day={{subst:CURRENTDAY}}}}
{{Information
|Description={{ru|??????? ???????? ????? ???????????? ?????????? ????????,
?????
?????? [[:ru:???????, ???????|?. ????????]], 70 ?????????, 1973 ???.<br/>
== ?????????????? ==

[[:ru:?????????:???????????:???????? ???????? ?????|]]}}
|Source=Transferred from [http://ru.wikipedia.org ru.wikipedia]<br/>
(Original text : ''??????????? ????????? [[:ru:????????:????????? ?.
?????|?????
???? ?. ?????]]'')
|Date=1980 ???; ????????? {{Date|2009|10|28}}<br/>
({{Date|2009|10|28}} (original upload date))
|Author=[[:ru:Deutsche Post|????? ???]].
Original uploader was [[:ru:User:????????? ?. ?????|????????? ?. ?????]] at
[htt
p://ru.wikipedia.org ru.wikipedia]
|Permission=PD-BECAUSE.
|other_versions=
}}

== {{int:license}} ==
{{PD-because|[[:ru:commons:Template:PD-Deutsche Bundespost stamps|]]}}
<!-- Templates "Template:????????? ?? ?????????" were used in the original
descr
iption page as well , but do not appear to exist on commons. -->

== Original upload log ==
The original description page is/was
[http://ru.wikipedia.org/w/index.php?title=
Image%3AA.schweizer.JPG here]. All following user names refer to
ru.wikipedia.
* 2009-10-28 16:37 [[:ru:User:????????? ?. ?????|????????? ?. ?????]]
356?208? (
19588 bytes) ''<nowiki>{{??????????? | ???????? = ???????? ????? |
???????
? = ??????????? ????????? | ????? ???????? = 1973 | ????? =
?????
??? }}</nowiki>''
__NOTOC__

{{subst:Unc}} <!-- Remove this line once you have added categories -->
Uploading file to commons:commons via API....
Error downloading data: 'ascii' codec can't decode byte 0xd0 in position
153: or
dinal not in range(128)
Request commons:/w/api.php?
Retrying in 1 minutes...
Retrying in 2 minutes...

It brokes on all images with the error: "Error downloading data: 'ascii'
codec can't decode byte 0xd0 in position 153: or
dinal not in range(128)"

Any ideas ?

Version:
Pywikipedia [http] trunk/pywikipedia (r7576, 2009/10/31, 00:35:16)
Python 2.5.2 (r252:60911, Mar 27 2008, 17:57:18) [MSC v.1310 32 bit
(Intel)]


Linar Khalitov ( rubin16 ) - 2009-10-31 12:45

9

Closed

Works For Me

Nobody/Anonymous

other

None

Public


Comments ( 7 )

Date: 2009-12-05 20:58
Sender: rubin16

checked - works OK, r7735


Date: 2009-11-25 22:14
Sender: multichill

Commenting out line 5464 seems to solve this:
#'Content-Length': str(len(data)),
Is this line needed for something else?


Date: 2009-11-25 22:09
Sender: multichill

Still not fixed in 7692. Upload is broken for three weeks now :-(

Uploading file to commons:commons...
Result: 411 Length Required
All done!
Traceback (most recent call last):
File "d:\Wikipedia\KIT_pywikipedia\kit_description_generator.py", line
254, in
<module>
main(sys.argv[1:])
File "d:\Wikipedia\KIT_pywikipedia\kit_description_generator.py", line
246, in
main
bot.run()
File "d:\Wikipedia\KIT_pywikipedia\upload.py", line 390, in run
return self.upload_image()
File "d:\Wikipedia\KIT_pywikipedia\upload.py", line 227, in
upload_image
return self._uploadImageOld(debug)
File "d:\Wikipedia\KIT_pywikipedia\upload.py", line 339, in
_uploadImageOld
cookies = self.targetSite.cookies())
File "d:\Wikipedia\KIT_pywikipedia\upload.py", line 38, in
post_multipart
return site.postData(address, body, contentType = contentType, cookies
= coo
kies)
File "d:\Wikipedia\KIT_pywikipedia\wikipedia.py", line 5482, in
postData
f = MyURLopener.open(request)
File "C:\Program Files\Python25\lib\urllib2.py", line 380, in open
response = meth(req, response)
File "C:\Program Files\Python25\lib\urllib2.py", line 491, in
http_response
'http', request, response, code, msg, hdrs)
File "C:\Program Files\Python25\lib\urllib2.py", line 412, in error
result = self._call_chain(*args)
File "C:\Program Files\Python25\lib\urllib2.py", line 353, in
_call_chain
result = func(*args)
File "d:\Wikipedia\KIT_pywikipedia\wikipedia.py", line 8232, in
http_error_302

self, req, fp, code, msg, headers)
File "C:\Program Files\Python25\lib\urllib2.py", line 575, in
http_error_302
return self.parent.open(new)
File "C:\Program Files\Python25\lib\urllib2.py", line 380, in open
response = meth(req, response)
File "C:\Program Files\Python25\lib\urllib2.py", line 491, in
http_response
'http', request, response, code, msg, hdrs)
File "C:\Program Files\Python25\lib\urllib2.py", line 418, in error
return self._call_chain(*args)
File "C:\Program Files\Python25\lib\urllib2.py", line 353, in
_call_chain
result = func(*args)
File "C:\Program Files\Python25\lib\urllib2.py", line 499, in
http_error_defau
lt
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 411: Length Required


Date: 2009-11-16 21:41
Sender: multichill

This isn't fixed

For example when running "imagecopy.py -lang:nl -family:wikipedia
-page:Bestand:Overzicht_theater_Mytilini.jpg"
I get:

Traceback (most recent call last):
File "C:\Program Files\Python25\lib\threading.py", line 460, in
__bootstrap
self.run()
File "D:\Wikipedia\pywikipedia\imagecopy.py", line 361, in run
bot.run()
File "D:\Wikipedia\pywikipedia\upload.py", line 387, in run
return self.upload_image()
File "D:\Wikipedia\pywikipedia\upload.py", line 224, in upload_image
return self._uploadImageOld(debug)
File "D:\Wikipedia\pywikipedia\upload.py", line 292, in _uploadImageOld
self.read_file_content()
File "D:\Wikipedia\pywikipedia\upload.py", line 113, in
read_file_content
file = uo.open(self.url)
File "C:\Program Files\Python25\lib\urllib2.py", line 380, in open
response = meth(req, response)
File "C:\Program Files\Python25\lib\urllib2.py", line 491, in
http_response
'http', request, response, code, msg, hdrs)
File "C:\Program Files\Python25\lib\urllib2.py", line 418, in error
return self._call_chain(*args)
File "C:\Program Files\Python25\lib\urllib2.py", line 353, in
_call_chain
result = func(*args)
File "C:\Program Files\Python25\lib\urllib2.py", line 499, in
http_error_defau
lt
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden



Date: 2009-11-15 19:41
Sender: xqt

fixed in r7648-7650 by alexsh


Date: 2009-11-06 10:25
Sender: rubin16

New behaviour since upload.py was updated:

C:\pt>imagecopy.py
-cat:Изображения:К_переносу_на_Викисклад
Getting [[Категория:Изображения:К переносу
на Викисклад]]...
Getting 60 pages from wikipedia:ru...
Getting 1 pages from wikipedia:ru...
username=&doit=Uitvoeren&ignorewarnings=1&commonsense=1&language=ru&newname=A.sc
hweizer.JPG&image=A.schweizer.JPG&project=wikipedia&remove_categories=1
Getting 1 pages from wikipedia:ru...
Got CH desc.

{{Information
|Description={{ru|Гашёная почтовая марка
Федеративной Республики Германия, посвя
щённая [[:ru:Швейцер, Альберт|А. Швейцеру]],
70 пфеннигов, 1973 год.<br/>
== Лицензирование ==

[[:ru:Категория:Изображения:Немецкие
почтовые марки|]]}}
|Source=Transferred from [http://ru.wikipedia.org ru.wikipedia]<br/>
(Original text : ''собственная коллекция
[[:ru:Участник:Александр в. марин|Алекс
андр в. марин]]'')
|Date=1980 год; загружено {{Date|2009|10|28}}<br/>
({{Date|2009|10|28}} (original upload date))
|Author=[[:ru:Deutsche Post|почта ФРГ]].
Original uploader was [[:ru:User:Александр в.
марин|Александр в. марин]] at [htt
p://ru.wikipedia.org ru.wikipedia]
|Permission=PD-BECAUSE.
|other_versions=
}}

== {{int:license}} ==
{{PD-because|[[:ru:commons:Template:PD-Deutsche Bundespost stamps|]]}}
<!-- Templates "Template:Перенести на Викисклад" were
used in the original descr
iption page as well , but do not appear to exist on commons. -->

== Original upload log ==
The original description page is/was
[http://ru.wikipedia.org/w/index.php?title=
Image%3AA.schweizer.JPG here]. All following user names refer to
ru.wikipedia.
* 2009-10-28 16:37 [[:ru:User:Александр в.
марин|Александр в. марин]] 356?208? (
19588 bytes) ''<nowiki>{{Изображение | Описание =
почтовая марка | Источни
к = собственная коллекция | Время
создания = 1973 | Автор = почта
ФРГ }}</nowiki>''
__NOTOC__

[[Category:Albert Schweitzer]]
Reading file
http://upload.wikimedia.org/wikipedia/ru/9/93/A.schweizer.JPG
Exception in thread Thread-2:
Traceback (most recent call last):
File "C:\Python25\lib\threading.py", line 488, in __bootstrap_inner
self.run()
File "C:\pt\imagecopy.py", line 280, in run
bot.run()
File "C:\pt\upload.py", line 387, in run
return self.upload_image()
File "C:\pt\upload.py", line 227, in upload_image
self.read_file_content()
File "C:\pt\upload.py", line 108, in read_file_content
uo = wikipedia.MyURLopener()
AttributeError: OpenerDirector instance has no __call__ method

C:\pt>version.py
Pywikipedia [http] trunk/pywikipedia (r7602, 2009/11/06, 07:10:02)
Python 2.5.2 (r252:60911, Mar 27 2008, 17:57:18) [MSC v.1310 32 bit
(Intel)]

Something wrong with my Python package ?


Date: 2009-11-04 08:27
Sender: rubin16

works OK, if changed to use_api = false...



Attached File

No Files Currently Attached

Changes ( 15 )

Field Old Value Date By
close_date - 2009-12-05 20:58 rubin16
allow_comments 1 2009-12-05 20:58 rubin16
resolution_id Accepted 2009-12-05 20:58 rubin16
status_id Open 2009-12-05 20:58 rubin16
priority 8 2009-11-25 22:09 multichill
resolution_id Fixed 2009-11-16 21:41 multichill
priority 5 2009-11-16 21:41 multichill
allow_comments 0 2009-11-16 21:41 multichill
close_date 2009-11-15 19:41 2009-11-16 21:41 multichill
status_id Closed 2009-11-16 21:41 multichill
status_id Open 2009-11-15 19:41 xqt
resolution_id None 2009-11-15 19:41 xqt
allow_comments 1 2009-11-15 19:41 xqt
close_date - 2009-11-15 19:41 xqt
summary imagecopy.py problem 2009-11-12 14:02 rubin16