Hi
Sorry for the noise!
After using Pywikipedia for a while now with no system problems I am all of a sudden struck with an encoding error message when trying to either do page.get() or page.put().
The error is: ... File "C:\Dev\pywikipedia\wikipedia.py", line 4102, in getUrl self.checkCharset(charset) File "C:\Dev\pywikipedia\wikipedia.py", line 5192, in checkCharset % (repr(self), charset, self.encoding())) ValueError: code2encodings has wrong charset for mylocalwiki:en. It should be iso-8859-1, but is utf-8
I have lately made two changes to my system. The first was to perform a "svn update" to get the latest Pywikipedia codebase (I am at revision 5059). The second was to install Service Pack 1 on my MS Vista machine. I have a strange feeling it could be the latter that is causing me this trouble now, although I can't be sure.
According to http://botwiki.sno.cc/wiki/Manual:Speed_guide_for_pywikipediabot you find the correct "console_encoding" value using "print sys.stdout.encoding". My system gives me 'cp850' so I added the line "console_encoding='cp850'" to my user-config.py file. However, I still get the same error message. In fact I have also tried to set "console_encoding" to both 'utf-8' and 'iso-8859-1' without the error message giving any indication of noticing my file changes (same error message no matter the 'console_encoding' value, in other words).
Debugging the wikipedia.py file and breaking on method checkCharset() gives the charset variable as 'iso-8859-1', but the encoding() method returns 'utf-8' causing the error.
My family file is very simple and holds no reference to any encoding.
Does anyone have any idea why this is happening now and what I can do to resolve it? As mentioned, I am running on Vista, but in production it will be on Linux.
Regards Lee Francis
pywikipedia-l@lists.wikimedia.org