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.
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
It was a bug on our end - we were incorrectly handling urls, which caused python to try and interpret the image data as text. Not surprisingly, this results in errors.
https://gerrit.wikimedia.org/r/80228 and https://gerrit.wikimedia.org/r/80229 both fix this (but in different and complementary ways).
For now, the easiest fix is opening your generated family file (families/tropical_family.py) and removing the u in both u' www.tropicalwikis.com' and u'/w'.
Merlijn
On 21 August 2013 11:36, AugurNZ augurnz@orcon.net.nz wrote:
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
That worked perfectly, thank you Merlijn.
It was a bug on our end - we were incorrectly handling urls, which caused python to try and interpret the image data as text. Not surprisingly, this results in errors.
https://gerrit.wikimedia.org/r/80228 and https://gerrit.wikimedia.org/r/80229 both fix this (but in different and complementary ways).
For now, the easiest fix is opening your generated family file (families/tropical_family.py) and removing the u in both u' www.tropicalwikis.com' and u'/w'.
Merlijn
On 21 August 2013 11:36, AugurNZ augurnz@orcon.net.nz wrote:
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...
[snip!]
Does cosemetic_changes.py only support monobook?
We use Vector as the default skin and I'm getting the following:
=====<cut here>=====
python cosmetic_changes.py -page:User:Magill/Projects-History-1
ATTENTION: You can run this script as a stand-alone for testing purposes. However, the changes that are made are only minor, and other users might get angry if you fill the version histories and watchlists with such irrelevant changes. Some wikis prohibit stand-alone running. Do you really want to continue? ([y]es, [N]o) y Getting 1 page from lotro-wiki:en... Traceback (most recent call last): File "/Users/magill/pywikipedia/pagegenerators.py", line 1234, in __iter__ for loaded_page in self.preload(somePages): File "/Users/magill/pywikipedia/pagegenerators.py", line 1253, in preload pywikibot.getall(site, pagesThisSite) File "/Users/magill/pywikipedia/wikipedia.py", line 5480, in getall _GetAll(site, pages, throttle, force).run() File "/Users/magill/pywikipedia/wikipedia.py", line 5097, in run data = self.getData() File "/Users/magill/pywikipedia/wikipedia.py", line 5281, in getData response, data = self.site.postForm(address, predata) File "/Users/magill/pywikipedia/wikipedia.py", line 6463, in postForm cookies=self.cookies(sysop = sysop)) File "/Users/magill/pywikipedia/wikipedia.py", line 6514, in postData raise PageNotFound(u'Page %s could not be retrieved. Check your family file ?' % url) PageNotFound: Page http://lotro-wiki.com/index.php?title=Special:Export&useskin=monobook could not be retrieved. Check your family file ? Page http://lotro-wiki.com/index.php?title=Special:Export&useskin=monobook could not be retrieved. Check your family file ? =====<cut here>=====
Especially, I don't understand the reference to the Family File.
"README-family.txt" makes no reference to either "style' or "mono."
Manual:Pywikipediabot/cosmetic changes.py -- doesn't mention any restriction
I also note that page has a "cute" little SubVersion Daemon -- which I'm guessing ALL of the script pages have.
Also "docs" fails. =====<cut here>=====
python maintenance/release.py
* create docs from docstrings in HTML and LaTeX (PDF) format [doxygen & doxypy] (enable doxypy by downloading doxypy.py from http://code.foosel.org/doxypy, placing it into the docs/ folder and uncommenting the doxypy related lines in Doxygen config file) sh: -c: line 0: syntax error near unexpected token `>' sh: -c: line 0: `doxygen &>> /Users/magill/pywikipedia/docs/release-doxygen.log' * run unittests [nosetests] * create coverage report in HTML format [coverage] sh: coverage: command not found =====<cut here>=====
release-nosetests.log contains only one line: Thu Aug 22 02:38:26 2013 sh: nosetests: command not found
T.T.F.N. William H. Magill # iMac11,3 Core i7 [2.93GHz - 8 GB 1067MHz] OS X 10.8.4 # MacBook Pro4.1 Core 2 Duo [2.5GHz - 4GB 667] OS X 10.6.8 # Macmini6,1 Intel Core i5 [2.5 Ghz - 4GB 1600MHz] OS X 10.8.3
magill@icloud.com magill@mac.com whmagill@gmail.com
Seems you are using the compat version of the framework and the "old API" Special:Export ist not availlable on your wiki.
Would you please check whether there is a special page Special:Export on your wiki at all?
If you haven't, you must use the core version of the framework.
Best xqt
----- Original Nachricht ---- Von: "William H. Magill" magill@icloud.com An: Pywikipedia discussion list pywikipedia-l@lists.wikimedia.org Datum: 22.08.2013 08:52 Betreff: [Pywikipedia-l] Does cosemetic_changes.py only support monobook?
Does cosemetic_changes.py only support monobook?
We use Vector as the default skin and I'm getting the following:
=====<cut here>=====
python cosmetic_changes.py -page:User:Magill/Projects-History-1
ATTENTION: You can run this script as a stand-alone for testing purposes. However, the changes that are made are only minor, and other users might get angry if you fill the version histories and watchlists with such irrelevant changes. Some wikis prohibit stand-alone running. Do you really want to continue? ([y]es, [N]o) y Getting 1 page from lotro-wiki:en... Traceback (most recent call last): File "/Users/magill/pywikipedia/pagegenerators.py", line 1234, in __iter__ for loaded_page in self.preload(somePages): File "/Users/magill/pywikipedia/pagegenerators.py", line 1253, in preload pywikibot.getall(site, pagesThisSite) File "/Users/magill/pywikipedia/wikipedia.py", line 5480, in getall _GetAll(site, pages, throttle, force).run() File "/Users/magill/pywikipedia/wikipedia.py", line 5097, in run data = self.getData() File "/Users/magill/pywikipedia/wikipedia.py", line 5281, in getData response, data = self.site.postForm(address, predata) File "/Users/magill/pywikipedia/wikipedia.py", line 6463, in postForm cookies=self.cookies(sysop = sysop)) File "/Users/magill/pywikipedia/wikipedia.py", line 6514, in postData raise PageNotFound(u'Page %s could not be retrieved. Check your family file ?' % url) PageNotFound: Page http://lotro-wiki.com/index.php?title=Special:Export&useskin=monobook could not be retrieved. Check your family file ? Page http://lotro-wiki.com/index.php?title=Special:Export&useskin=monobook could not be retrieved. Check your family file ? =====<cut here>=====
Especially, I don't understand the reference to the Family File.
"README-family.txt" makes no reference to either "style' or "mono."
Manual:Pywikipediabot/cosmetic changes.py -- doesn't mention any restriction
I also note that page has a "cute" little SubVersion Daemon -- which I'm guessing ALL of the script pages have.
Also "docs" fails. =====<cut here>=====
python maintenance/release.py
- create docs from docstrings in HTML and LaTeX (PDF) format [doxygen & doxypy] (enable doxypy by downloading doxypy.py from
http://code.foosel.org/doxypy, placing it into the docs/ folder and uncommenting the doxypy related lines in Doxygen config file) sh: -c: line 0: syntax error near unexpected token `>' sh: -c: line 0: `doxygen &>> /Users/magill/pywikipedia/docs/release-doxygen.log'
- run unittests [nosetests]
- create coverage report in HTML format [coverage]
sh: coverage: command not found =====<cut here>=====
release-nosetests.log contains only one line: Thu Aug 22 02:38:26 2013 sh: nosetests: command not found
T.T.F.N. William H. Magill # iMac11,3 Core i7 [2.93GHz - 8 GB 1067MHz] OS X 10.8.4 # MacBook Pro4.1 Core 2 Duo [2.5GHz - 4GB 667] OS X 10.6.8 # Macmini6,1 Intel Core i5 [2.5 Ghz - 4GB 1600MHz] OS X 10.8.3
magill@icloud.com magill@mac.com whmagill@gmail.com
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
On Aug 22, 2013, at 3:44 AM, info@gno.de wrote:
Seems you are using the compat version of the framework and the "old API" Special:Export ist not availlable on your wiki.
Would you please check whether there is a special page Special:Export on your wiki at all?
If you haven't, you must use the core version of the framework.
1- This is a semantic MediaWiki...
2- Yes, there is a "Export pages to RDF" entry in Special Pages under Semantic MediaWiki.
3- I'm using ?the last? SVN version -- downloaded on 1 July, just before you converted to GIT
4- I have no idea what the "compat version" of the framework happens to be, nor the "core version"
I have been doing test runs with the bot and they seem to work... this was one of the things I was trying to test.
----- Original Nachricht ---- Von: "William H. Magill" magill@icloud.com An: Pywikipedia discussion list pywikipedia-l@lists.wikimedia.org Datum: 22.08.2013 08:52 Betreff: [Pywikipedia-l] Does cosemetic_changes.py only support monobook?
Does cosemetic_changes.py only support monobook?
We use Vector as the default skin and I'm getting the following:
=====<cut here>=====
python cosmetic_changes.py -page:User:Magill/Projects-History-1
ATTENTION: You can run this script as a stand-alone for testing purposes. However, the changes that are made are only minor, and other users might get angry if you fill the version histories and watchlists with such irrelevant changes. Some wikis prohibit stand-alone running. Do you really want to continue? ([y]es, [N]o) y Getting 1 page from lotro-wiki:en... Traceback (most recent call last): File "/Users/magill/pywikipedia/pagegenerators.py", line 1234, in __iter__ for loaded_page in self.preload(somePages): File "/Users/magill/pywikipedia/pagegenerators.py", line 1253, in preload pywikibot.getall(site, pagesThisSite) File "/Users/magill/pywikipedia/wikipedia.py", line 5480, in getall _GetAll(site, pages, throttle, force).run() File "/Users/magill/pywikipedia/wikipedia.py", line 5097, in run data = self.getData() File "/Users/magill/pywikipedia/wikipedia.py", line 5281, in getData response, data = self.site.postForm(address, predata) File "/Users/magill/pywikipedia/wikipedia.py", line 6463, in postForm cookies=self.cookies(sysop = sysop)) File "/Users/magill/pywikipedia/wikipedia.py", line 6514, in postData raise PageNotFound(u'Page %s could not be retrieved. Check your family file ?' % url) PageNotFound: Page http://lotro-wiki.com/index.php?title=Special:Export&useskin=monobook could not be retrieved. Check your family file ? Page http://lotro-wiki.com/index.php?title=Special:Export&useskin=monobook could not be retrieved. Check your family file ? =====<cut here>=====
Especially, I don't understand the reference to the Family File.
"README-family.txt" makes no reference to either "style' or "mono."
Manual:Pywikipediabot/cosmetic changes.py -- doesn't mention any restriction
I also note that page has a "cute" little SubVersion Daemon -- which I'm guessing ALL of the script pages have.
Also "docs" fails. =====<cut here>=====
python maintenance/release.py
- create docs from docstrings in HTML and LaTeX (PDF) format
[doxygen & doxypy] (enable doxypy by downloading doxypy.py from http://code.foosel.org/doxypy, placing it into the docs/ folder and uncommenting the doxypy related lines in Doxygen config file) sh: -c: line 0: syntax error near unexpected token `>' sh: -c: line 0: `doxygen &>> /Users/magill/pywikipedia/docs/release-doxygen.log'
- run unittests
[nosetests]
- create coverage report in HTML format
[coverage] sh: coverage: command not found =====<cut here>=====
release-nosetests.log contains only one line: Thu Aug 22 02:38:26 2013 sh: nosetests: command not found
T.T.F.N. William H. Magill # iMac11,3 Core i7 [2.93GHz - 8 GB 1067MHz] OS X 10.8.4 # MacBook Pro4.1 Core 2 Duo [2.5GHz - 4GB 667] OS X 10.6.8 # Macmini6,1 Intel Core i5 [2.5 Ghz - 4GB 1600MHz] OS X 10.8.3
magill@icloud.com magill@mac.com whmagill@gmail.com
On Thu, Aug 22, 2013 at 4:14 AM, William H. Magill magill@icloud.comwrote:
On Aug 22, 2013, at 3:44 AM, info@gno.de wrote:
Seems you are using the compat version of the framework and the "old
API" Special:Export ist not availlable on your wiki.
4- I have no idea what the "compat version" of the framework happens to be, nor the "core version"
"Version" is a bit of a misnomer in that they're two separate branches developed in parallel. They also got renamed during the SVN to Git migration, further muddying the waters.
What was the SVN "trunk" branch (ie default) is now named "compat" in Git and the previous SVN "rewrite" branch is called "core" in Git.
Tom
pywikipedia-l@lists.wikimedia.org