Skip to content

Commit ab5ed7b

Browse files
author
Ralf Schlatterbeck
committed
1 parent b190f67 commit ab5ed7b

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ are given with the most recent entry first.
55

66
Fixed:
77
- Handle multiple @action values from broken trackers.
8+
- xmlrpc handling of unicode characters, see
9+
http://thread.gmane.org/gmane.comp.bug-tracking.roundup.user/10040
810

911

1012
2010-02-23 1.5.0

roundup/xmlrpc.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,17 @@ def props_from_args(db, cl, args, itemid=None):
3434
for arg in args:
3535
if arg.find('=') == -1:
3636
raise UsageError, 'argument "%s" not propname=value'%arg
37-
l = arg.split('=')
38-
if len(l) < 2:
37+
try :
38+
key, value = arg.split('=', 1)
39+
except ValueError :
3940
raise UsageError, 'argument "%s" not propname=value'%arg
40-
key, value = l[0], '='.join(l[1:])
41+
if isinstance (key, unicode) :
42+
try :
43+
key = key.encode ('ascii')
44+
except UnicodeEncodeError:
45+
raise UsageError, 'argument %r is no valid ascii keyword'%key
46+
if isinstance (value, unicode) :
47+
value = value.encode ('utf-8')
4148
if value:
4249
try:
4350
props[key] = hyperdb.rawToHyperdb(db, cl, itemid,

0 commit comments

Comments
 (0)