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