Issue 7 in pyactiveresource: Encoding trouble

3 views
Skip to first unread message

codesite...@google.com

unread,
Jun 19, 2009, 7:05:17 AM6/19/09
to pyactive...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 7 by timothee.peignier: Encoding trouble
http://code.google.com/p/pyactiveresource/issues/detail?id=7

What steps will reproduce the problem?
1. Save a object with a text value encoded in utf-8 (with accents)

What is the expected output? What do you see instead?
Saving the object without trouble, instead there is an encoding error :

/env/lib/python2.5/site-packages/pyactiveresource/util.py in to_xml(obj,
root, pretty, header)
234 element = ET.SubElement(root_element, key)
235 if value is not None:
--> 236 element.text = str(value)
237 if isinstance(value, bool):
238 element.text = element.text.lower()
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in
position 53: ordinal not in
range(128)

I've attached a patch that fix it (without unit test).

Attachments:
7-unicode-value.diff 550 bytes

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

codesite...@google.com

unread,
Jun 19, 2009, 1:29:23 PM6/19/09
to pyactive...@googlegroups.com
Updates:
Status: Fixed
Owner: mark.r.roach

Comment #1 on issue 7 by mark.r.roach: Encoding trouble
http://code.google.com/p/pyactiveresource/issues/detail?id=7

Thanks for the patch, Timothee. I have fixed that in subversion.

Reply all
Reply to author
Forward
0 new messages