pombreda / wave-robot-python-client

Automatically exported from code.google.com/p/wave-robot-python-client
Apache License 2.0
0 stars 0 forks source link

Robots API unicode support #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add an empty robot to a wave with unicode characters to it
2. Observe the App Engine logs

What is the expected output? What do you see instead?
Expected output: Wave content is being submitted to the robot.
Observed output: "UnicodeEncodeError: 'ascii' codec can't encode character 
u'\xe1' in position 12: ordinal not in range(128)" (see logs below)

What version of the product are you using? On what operating system?
Checked out trunk from:
http://code.google.com/p/wave-robot-python-
client/source/browse/#svn/trunk/src/waveapi
OS: your very own platform

Attached logs below, or see 
http://appengine.google.com/logs?
&app_id=wavegroupy&version_id=22.337087055480484049#
directly

10.230.24.131 - - [18/Oct/2009:00:07:59 -0700] "POST /_wave/robot/jsonrpc 
HTTP/1.1" 500 1886 - "Jakarta Commons-HttpClient/3.1,gzip(gfe)" 
"wavegroupy.appspot.com"
E 10-18 12:07AM 59.966
'ascii' codec can't encode character u'\xe1' in position 12: ordinal not in 
range(128)
Traceback (most recent call last):
  File 
"/base/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 
509, in __call__
    handler.post(*groups)
  File 
"/base/data/home/apps/wavegroupy/22.337087055480484049/waveapi/robot.py", 
line 90, in post
    context, events = robot_abstract.ParseJSONBody(json_body)
  File 
"/base/data/home/apps/wavegroupy/22.337087055480484049/waveapi/robot_abstra
ct.py", line 37, in ParseJSONBody
    context = ops.CreateContext(data)
  File 
"/base/data/home/apps/wavegroupy/22.337087055480484049/waveapi/ops.py", 
line 595, in CreateContext
    context.AddBlip(raw_blip_data)
  File 
"/base/data/home/apps/wavegroupy/22.337087055480484049/waveapi/ops.py", 
line 552, in AddBlip
    blip = OpBasedBlip(blip_data, self)
  File 
"/base/data/home/apps/wavegroupy/22.337087055480484049/waveapi/ops.py", 
line 186, in __init__
    super(OpBasedBlip, self).__init__(json)
  File 
"/base/data/home/apps/wavegroupy/22.337087055480484049/waveapi/model.py", 
line 192, in __init__
    self.elements[elem] = document.ElementFromJson(json_elements[elem])
  File 
"/base/data/home/apps/wavegroupy/22.337087055480484049/waveapi/document.py"
, line 204, in ElementFromJson
    return Gadget(url=url, props=props)
  File 
"/base/data/home/apps/wavegroupy/22.337087055480484049/waveapi/document.py"
, line 164, in __init__
    super(Gadget, self).__init__(ELEMENT_TYPE.GADGET, properties=props)
  File 
"/base/data/home/apps/wavegroupy/22.337087055480484049/waveapi/document.py"
, line 120, in __init__
    setattr(self, key, val)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in 
position 12: ordinal not in range(128)

Please provide any additional information below.

Original issue reported on code.google.com by sdrinf on 18 Oct 2009 at 6:29