nausheenfatma / python-wikitools

Automatically exported from code.google.com/p/python-wikitools
0 stars 0 forks source link

Unicode encode error #40

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Make a test script
#!/usr/bin/python
# -*- coding: UTF-8 -*-

from wikitools import wiki
from wikitools import api

# create a Wiki object
site = wiki.Wiki("http://www.wikitau.org/api.php") 
# define the params for the query
params = {'action':'query', 'titles':'Accueil'}
# create the request object
request = api.APIRequest(site, params)
# query the API
result = request.query()

2. run it :
./test.py

What is the expected output?
I supose I would get the content of the Main page

What do you see instead?
  File "/usr/local/lib/python2.7/dist-packages/wikitools/wiki.py", line 109, in setSiteinfo
    setattr(self, attr, Namespace(ns))          
UnicodeEncodeError: 'ascii' codec can't encode character u'\xc9' in position 
15: ordinal not in range(128)

What version of the product are you using? On what operating system?

1.1.1
Please provide any additional information below.

Original issue reported on code.google.com by vpott...@gmail.com on 26 May 2011 at 1:33

GoogleCodeExporter commented 8 years ago
patched with

            setattr(self, repr(attr), Namespace(ns)) # patch FrViPofm

Original comment by vpott...@gmail.com on 1 Jun 2011 at 2:04

GoogleCodeExporter commented 8 years ago
This was fixed in r360

Original comment by MrZmanwiki@gmail.com on 7 Dec 2013 at 10:51