I got this one with that patch:
wikipedia:de:º_the_Bench_º
----- Original Nachricht ---- Von: "Dr. Trigon" dr.trigon@surfeu.ch An: Pywikipedia discussion list pywikipedia-l@lists.wikimedia.org Datum: 19.09.2010 13:15 Betreff: [Pywikipedia-l] Bug fix for userlib.User.__str__
Hello all
I recognized an issue, when executing the following code:
print userlib.User(pywikibot.getSite(), u'º_the_Bench_º')
results in
Traceback (most recent call last): File "tests/dtbext_tester.py", line 279, in <module> print userlib.User(pywikibot.getSite(), u'º_the_Bench_º') UnicodeEncodeError: 'ascii' codec can't encode character u'\xba' in position 13: ordinal not in range(128)
The u'\xba' is assigned to u'º' which raises an UnicodeEncodeError.
By using the patch attached, which simply adds an '.encode(self.site().encoding())' to the string produced the issues is solved for me. And produces:
wikipedia:de:º_the_Bench_º
May be the 'self.site().encoding()' should or has to be replaced by another var or const. But the encoding to something like 'utf8' is essential as statet in [1].
Thanks a lot and greetings DrTrigon
[1] http://wiki.python.org/moin/UnicodeEncodeError
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Heute erleben, was morgen Trend wird - das kann man auf der IFA in Berlin. Oder auf arcor.de: Wir stellen Ihnen die wichtigsten News, Trends und Gadgets der IFA vor. Natürlich mit dabei: das brandneue IPTV-Angebot von Vodafone! Alles rund um die Internationale Funkausstellung in Berlin finden Sie hier: http://www.arcor.de/rd/footer.ifa2010