The file I'm trying to upload is the *.png thumbnail of the Pywikipediabot logo from this page... http://www.mediawiki.org/wiki/File:Pwb_icon.svg
The thumbnail is called http://upload.wikimedia.org/wikipedia/commons/thumb/d/d2/Pwb_icon.svg/128px-... but I have shortened the filename, as per the example below, to "Pwbicon.png" (without the quotes). So the filename should not contain any non-ASCII chars. As for the file itself, I don't know, and wouldn't even know how to find out. ;)
For me it seems that you have an HTTP error on uploading and the error message contains a non-ASCII character. This is an old problem, nobody could solve it by this time. Does your uploaded file contain none-ASCII chars?
2013/8/21 AugurNZ augurnz@orcon.net.nz
Hi, I was pointed here from #pywikipediabot on Freenode IRC. I am using Pywikipediabot (trunk) revision 11781 under Ubuntu 12.04. I'm having no success using the upload.py script. It keeps failing with the following error message...
augur@ubuntu:/home/augur/pywikipedia# python upload.py -family:tropical -keep -filename:Pwbicon.png -noverify Pwbicon.png "The Pywikipediabot icon" No handlers could be found for logger "pywiki" Reading file Pwbicon.png The suggested description is: The Pywikipediabot icon Uploading file to tropical:en via API.... ERROR: UnicodeDecodeError: 'ascii' codec can't decode byte 0x89 in position 654: ordinal not in range(128) WARNING: Could not open 'http://www.tropicalwikis.com/w/api.php'. Maybe the server or your connection is down. Retrying in 1 minutes...
I can perform other actions on www.tropicalwikis.com with my bot, such as using login.py, replace.py etc. I have also tried using a different -family: and logging in to www.thetestwiki.org (where I also have a valid bot account) and tried uploading the image file there, with the same result.
I'm not a python expert, in fact I'm barely a python novice. I came across this information which may be relevant though... http://wiki.python.org/moin/UnicodeDecodeError
Thanks. AugurNZ
ps. sorry if this is a repeat of a previous message. I wasn't registered on the list when I first sent this, but I am now.
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
-- Bináris
can you run it in debugging mode? I mean add "-v" to the code: python upload.py -family:tropical -keep -filename:Pwbicon.png -noverify Pwbicon.png "The Pywikipediabot icon" -v
Best
On Wed, Aug 21, 2013 at 2:49 PM, AugurNZ augurnz@orcon.net.nz wrote:
The file I'm trying to upload is the *.png thumbnail of the Pywikipediabot logo from this page... http://www.mediawiki.org/wiki/File:Pwb_icon.svg
The thumbnail is called
http://upload.wikimedia.org/wikipedia/commons/thumb/d/d2/Pwb_icon.svg/128px-... but I have shortened the filename, as per the example below, to "Pwbicon.png" (without the quotes). So the filename should not contain any non-ASCII chars. As for the file itself, I don't know, and wouldn't even know how to find out. ;)
For me it seems that you have an HTTP error on uploading and the error message contains a non-ASCII character. This is an old problem, nobody could solve it by this time. Does your uploaded file contain none-ASCII chars?
2013/8/21 AugurNZ augurnz@orcon.net.nz
Hi, I was pointed here from #pywikipediabot on Freenode IRC. I am using Pywikipediabot (trunk) revision 11781 under Ubuntu 12.04. I'm having no success using the upload.py script. It keeps failing with the following error message...
augur@ubuntu:/home/augur/pywikipedia# python upload.py -family:tropical -keep -filename:Pwbicon.png -noverify Pwbicon.png "The Pywikipediabot icon" No handlers could be found for logger "pywiki" Reading file Pwbicon.png The suggested description is: The Pywikipediabot icon Uploading file to tropical:en via API.... ERROR: UnicodeDecodeError: 'ascii' codec can't decode byte 0x89 in position 654: ordinal not in range(128) WARNING: Could not open 'http://www.tropicalwikis.com/w/api.php'. Maybe the server or your connection is down. Retrying in 1 minutes...
I can perform other actions on www.tropicalwikis.com with my bot, such as using login.py, replace.py etc. I have also tried using a different -family: and logging in to www.thetestwiki.org (where I also have a valid bot account) and tried uploading the image file there, with the same result.
I'm not a python expert, in fact I'm barely a python novice. I came across this information which may be relevant though... http://wiki.python.org/moin/UnicodeDecodeError
Thanks. AugurNZ
ps. sorry if this is a repeat of a previous message. I wasn't registered on the list when I first sent this, but I am now.
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
-- Bináris
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
I have done that now, and uploaded the results as a Gist on GitHub... https://gist.github.com/AugurNZ/6294530
can you run it in debugging mode? I mean add "-v" to the code: python upload.py -family:tropical -keep -filename:Pwbicon.png -noverify Pwbicon.png "The Pywikipediabot icon" -v
Best
On Wed, Aug 21, 2013 at 2:49 PM, AugurNZ augurnz@orcon.net.nz wrote:
The file I'm trying to upload is the *.png thumbnail of the Pywikipediabot logo from this page... http://www.mediawiki.org/wiki/File:Pwb_icon.svg
The thumbnail is called
http://upload.wikimedia.org/wikipedia/commons/thumb/d/d2/Pwb_icon.svg/128px-... but I have shortened the filename, as per the example below, to "Pwbicon.png" (without the quotes). So the filename should not contain any non-ASCII chars. As for the file itself, I don't know, and wouldn't even know how to find out. ;)
For me it seems that you have an HTTP error on uploading and the error message contains a non-ASCII character. This is an old problem, nobody could solve it by this time. Does your uploaded file contain none-ASCII chars?
[snip!]
Thank you! I want you to do a tricky thing: *open upload.py *change the line that has "__init__(self, url, urlEncoding=None, description=u''" to "__init__(self, url, urlEncoding='utf-8', description=u''" (change urlEncoding from "None" to "'utf-8'") *try again with -v option *tell me what happens
If you can't do that. tell me to send you the code Best
On 8/21/13, AugurNZ augurnz@orcon.net.nz wrote:
I have done that now, and uploaded the results as a Gist on GitHub... https://gist.github.com/AugurNZ/6294530
can you run it in debugging mode? I mean add "-v" to the code: python upload.py -family:tropical -keep -filename:Pwbicon.png -noverify Pwbicon.png "The Pywikipediabot icon" -v
Best
On Wed, Aug 21, 2013 at 2:49 PM, AugurNZ augurnz@orcon.net.nz wrote:
The file I'm trying to upload is the *.png thumbnail of the Pywikipediabot logo from this page... http://www.mediawiki.org/wiki/File:Pwb_icon.svg
The thumbnail is called
http://upload.wikimedia.org/wikipedia/commons/thumb/d/d2/Pwb_icon.svg/128px-... but I have shortened the filename, as per the example below, to "Pwbicon.png" (without the quotes). So the filename should not contain any non-ASCII chars. As for the file itself, I don't know, and wouldn't even know how to find out. ;)
For me it seems that you have an HTTP error on uploading and the error message contains a non-ASCII character. This is an old problem, nobody could solve it by this time. Does your uploaded file contain none-ASCII chars?
[snip!]
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
I have done that now, and the error message comes back exactly the same as it did prior to this change. Lines 83 to 86 of my upload.py file are shown below, after the change you suggested...
83 class UploadRobot: 84 def __init__(self, url, urlEncoding='utf-8', description=u'', 85 useFilename=None, keepFilename=False, verifyDescription=True, 86 ignoreWarning=False, targetSite=None, uploadByUrl=False):
Thank you! I want you to do a tricky thing: *open upload.py *change the line that has "__init__(self, url, urlEncoding=None, description=u''" to "__init__(self, url, urlEncoding='utf-8', description=u''" (change urlEncoding from "None" to "'utf-8'") *try again with -v option *tell me what happens
If you can't do that. tell me to send you the code Best
On 8/21/13, AugurNZ augurnz@orcon.net.nz wrote:
I have done that now, and uploaded the results as a Gist on GitHub... https://gist.github.com/AugurNZ/6294530
can you run it in debugging mode? I mean add "-v" to the code: python upload.py -family:tropical -keep -filename:Pwbicon.png -noverify Pwbicon.png "The Pywikipediabot icon" -v
Best
On Wed, Aug 21, 2013 at 2:49 PM, AugurNZ augurnz@orcon.net.nz wrote:
The file I'm trying to upload is the *.png thumbnail of the Pywikipediabot logo from this page... http://www.mediawiki.org/wiki/File:Pwb_icon.svg
The thumbnail is called
http://upload.wikimedia.org/wikipedia/commons/thumb/d/d2/Pwb_icon.svg/128px-... but I have shortened the filename, as per the example below, to "Pwbicon.png" (without the quotes). So the filename should not contain any non-ASCII chars. As for the file itself, I don't know, and wouldn't even know how to find out. ;)
For me it seems that you have an HTTP error on uploading and the
error
message contains a non-ASCII character. This is an old problem,
nobody
could solve it by this time. Does your uploaded file contain none-ASCII chars?
[snip!]
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
-- Amir
pywikipedia-l@lists.wikimedia.org