On 26 March 2012 02:01, valhallasw@svn.wikimedia.org wrote:
Revision: 10043 Author: valhallasw Date: 2012-03-26 00:01:16 +0000 (Mon, 26 Mar 2012) Log Message:
(...)
Behavioural change: windows now either inputs/outputs ascii (without ctypes) or full unicode (with ctypes). Yes, no more chcp crap!
Update to r10043 to feel the magic!
(I have tested windows XP using python 2.5.4 and 2.7.2 and linux using python 2.7.1. Unicode command-line arguments are not supported (yet), as this requires reworking all sys.argv to pywikipedia-managed code. If stuff breaks, go back to r10042 and send an e-mail).
Best, Merlijn
On 26 March 2012 02:06, Merlijn van Deen valhallasw@arctus.nl wrote:
Update to r10043 to feel the magic!
Make that r10044.
Merlijn
My bot on Hungarian toolserver is broken.
First script: Traceback (most recent call last): File "pywikipedia/frissdump.py", line 43, in <module> pywikibot.output(u'A legfrissebb dump dĂĄtuma: ' + friss) File "/home/binaris/pywikipedia/wikipedia.py", line 7986, in output ui.output(text, toStdout = toStdout) File "/home/binaris/pywikipedia/userinterfaces/terminal_interface_base.py", line 102, in output self._print(text, targetStream) File "/home/binaris/pywikipedia/userinterfaces/terminal_interface_base.py", line 59, in _print self.printNonColorized(text, targetStream) File "/home/binaris/pywikipedia/userinterfaces/terminal_interface_base.py", line 51, in printNonColorized targetStream.write(line.encode(self.encoding, 'replace')) AttributeError: UnixUI instance has no attribute 'encoding'
Second script: Traceback (most recent call last): File "pywikipedia/toc.py", line 124, in <module> pywikibot.output('Initializing (getting month names takes a while)') File "/home/binaris/pywikipedia/wikipedia.py", line 7986, in output ui.output(text, toStdout = toStdout) File "/home/binaris/pywikipedia/userinterfaces/terminal_interface_base.py", line 102, in output self._print(text, targetStream) File "/home/binaris/pywikipedia/userinterfaces/terminal_interface_base.py", line 59, in _print self.printNonColorized(text, targetStream) File "/home/binaris/pywikipedia/userinterfaces/terminal_interface_base.py", line 51, in printNonColorized targetStream.write(line.encode(self.encoding, 'replace')) AttributeError: UnixUI instance has no attribute 'encoding'
Version.py: Pywikipedia [http] trunk/pywikipedia (r10045, 2012/03/26, 00:17:53) Python 2.7.2+ (default, Aug 16 2011, 09:23:59) [GCC 4.6.1] config-settings: use_api = True use_api_login = True unicode test: ok
Linux version 2.6.32-5-openvz-amd64 (Debian 2.6.32-39squeeze1) ( dannf@debian.org) (gcc version 4.3.5 (Debian 4.3.5-4) ) #1 SMP Mon Jan 9 21:16:36 UTC 2012
2012/3/26 Bináris wikiposta@gmail.com:
My bot on Hungarian toolserver is broken.
First script: Traceback (most recent call last): File "/home/binaris/pywikipedia/userinterfaces/terminal_interface_base.py", line 51, in printNonColorized
Oops. Even with all the different versions, I had not tested with all the different config options, such as config.colorized_output. This is fixed in r10046, as well as a related win32 bug.
Thanks for reporting!
Merlijn
Thanks.
*Replace.py* is broken totally. I am not sure it is connected to this, but nothing else has been changed.
Whatever I press in replace (yes, no, browser, edit, quit) it is NOT DONE, and an additional enter has to be pressed, after what the bot shows the next article to be corrected. It edits nothing, launches nothing. Quitting can be done by ctrl C.
On 26 March 2012 10:21, Bináris wikiposta@gmail.com wrote:
Whatever I press in replace (yes, no, browser, edit, quit) it is NOT DONE, and an additional enter has to be pressed, after what the bot shows the next article to be corrected. It edits nothing, launches nothing. Quitting can be done by ctrl C.
Windows? Linux? If it's on windows, it's the second bug I fixed in r10046, which caused a double readline() - and only the second one was interpreted.
If it's on Linux... no clue. Could you press ctrl-c in the input window and mail the stack trace?
Sigh. This is what you get when you edit code without automated tests ;-)
Merlijn
2012/3/26 Merlijn van Deen valhallasw@arctus.nl
Windows? Linux? If it's on windows, it's the second bug I fixed in r10046, which caused a double readline() - and only the second one was interpreted.
This one was Windows, and both problems corrected successfully, thanks. I am afraid to ask, what is the magic I should see?
On 26 March 2012 10:49, Bináris wikiposta@gmail.com wrote:
This one was Windows, and both problems corrected successfully, thanks. I am afraid to ask, what is the magic I should see?
It solves your € sign problem. In addition, the bot should now output <russian, hebrew, hindi, ...> without any yellow texts. For instance, interwiki.py now outputs:
[[nl:Zomertijd]]: [[nl:Zomertijd]] gives new interwiki [[bn:দিবালোক সংরক্ষণ সময় ]] [[nl:Zomertijd]]: [[nl:Zomertijd]] gives new interwiki [[yi:זומער זייגער]] [[nl:Zomertijd]]: [[nl:Zomertijd]] gives new interwiki [[de:Sommerzeit]] [[nl:Zomertijd]]: [[nl:Zomertijd]] gives new interwiki [[uk:Літній час]] [[nl:Zomertijd]]: [[nl:Zomertijd]] gives new interwiki [[ba:Йәйге ваҡыт]] [[nl:Zomertijd]]: [[nl:Zomertijd]] gives new interwiki [[hr:Ljetno računanje vre mena]] [[nl:Zomertijd]]: [[nl:Zomertijd]] gives new interwiki [[da:Sommertid]] [[nl:Zomertijd]]: [[nl:Zomertijd]] gives new interwiki [[be:Летні час]] [[nl:Zomertijd]]: [[nl:Zomertijd]] gives new interwiki [[pt:Horário de verão]]
Best, Merlijn
On 26 March 2012 10:56, Merlijn van Deen valhallasw@arctus.nl wrote:
It solves your € sign problem. In addition, the bot should now output <russian, hebrew, hindi, ...> without any yellow texts. For instance, interwiki.py now outputs:
(on windows - this is not news for unix, of course).
Screenshot: http://i.imgur.com/H92Or.png
Merlijn
2012/3/26 Merlijn van Deen valhallasw@arctus.nl
It solves your € sign problem.
Not really. :-((( This was the first I have tried. The attached screenshot shows the yesterday and the today state each under other (as the window was left open for night fortunately). Euro is still ? and yen became a simple Y.
On 26 March 2012 11:07, Bináris wikiposta@gmail.com wrote:
Not really. :-((( This was the first I have tried. The attached screenshot shows the yesterday and the today state each under other (as the window was left open for night fortunately). Euro is still ? and yen became a simple Y.
Try switching your font for the console (from 'raster fonts' to 'lucida console', or better yet: consolas) (right-click on the icon on the top left, properties, fonts).
Merlijn
2012/3/26 Merlijn van Deen valhallasw@arctus.nl
Try switching your font for the console (from 'raster fonts' to 'lucida console', or better yet: consolas) (right-click on the icon on the top left, properties, fonts).
This one works, Thank you!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! You earned a beer whenever we meet. :-)
n Mon, Mar 26, 2012 at 11:30 AM, Merlijn van Deen valhallasw@arctus.nl wrote:
On 26 March 2012 11:07, Bináris wikiposta@gmail.com wrote:
Not really. :-((( This was the first I have tried. The attached screenshot shows the yesterday and the today state each under other (as the window was left open for night fortunately). Euro is still ? and yen became a simple Y.
Try switching your font for the console (from 'raster fonts' to 'lucida console', or better yet: consolas) (right-click on the icon on the top left, properties, fonts).
I had multiple problems on Windows too, but those seem to have been resolved with your advise. We should really be putting this somewhere noticeable for people using Windows, if only I had known this before...
2012/3/26 Andre Engels andreengels@gmail.com
I had multiple problems on Windows too, but those seem to have been resolved with your advise. We should really be putting this somewhere noticeable for people using Windows, if only I had known this before...
Soemwhere under http://www.mediawiki.org/wiki/Manual:Pywikipediabot (I have already written it to Hungarian version but now I have to leave).
On 26 March 2012 11:43, Andre Engels andreengels@gmail.com wrote:
I had multiple problems on Windows too, but those seem to have been resolved with your advise. We should really be putting this somewhere noticeable for people using Windows, if only I had known this before...
I've been playing around with some more Windows API functions. For Vista and above, we could detect the font (and set it or emit a warning); this is not possible for XP (and I don't have a Vista+ windows computer available at the moment).
Best, Merlijn
Please try this command without saving: replace.py -lang:hu -page:Stereopony Kiszecu kiszecu
I see a lot of rectangles in ''Szajonara no Kiszecu''|さよならの季節}} (but copied from DOS screen to here it appears correctly). Is that intentional?
On 27 March 2012 09:29, Bináris wikiposta@gmail.com wrote:
Please try this command without saving: replace.py -lang:hu -page:Stereopony Kiszecu kiszecu
I see a lot of rectangles in ''Szajonara no Kiszecu''|さよならの季節}} (but copied from DOS screen to here it appears correctly). Is that intentional?
They are displayed this way because the font doesn't have these glyphs. Choosing another font (which is difficult for cmd, but possible [1]) which does have these glyphs would fix it. However, I think copyable squares that work when you paste them in a browser are more useful than transliterated text.
Best, Merlijn
[1] http://www.johndcook.com/blog/2009/07/24/windows-console-fonts/
2012/3/27 Merlijn van Deen valhallasw@arctus.nl
However, I think copyable squares that work when you paste them in a browser are more useful than transliterated text.
OK. thanks. Alltogether it is much better now (especially that I can type accented letters freely).
Merlijn, do you think this may be connected to this complaint of Jan Dudík or are they independent? https://www.mediawiki.org/wiki/Pywikipediabot/Survey2012#ISO_8859-2
I really DO hate all character encoding problems. This is the biggest mess of informatics. :-(
On 12 April 2012 12:29, Bináris wikiposta@gmail.com wrote:
Merlijn, do you think this may be connected to this complaint of Jan Dudík or are they independent? https://www.mediawiki.org/wiki/Pywikipediabot/Survey2012#ISO_8859-2
That complaint is fixed now (I confirmed his problem; my solution works for all the more recent python versions)
I really DO hate all character encoding problems. This is the biggest mess of informatics. :-(
It's not that bad - it's just the backwards compatibility (and thus the windows console) that sucks.
best, Merlijn
pywikipedia-l@lists.wikimedia.org