# HG changeset patch # User Sylvain Thénault # Date 1312388162 -7200 # Node ID 48e78934a4e27b07e646146a35ca58a627e52b13 # Parent 8d0edec31aafdddb8ad8c45934bf15a626eb6e6e [datafeed] properly encode/decode external uri diff -r 8d0edec31aaf -r 48e78934a4e2 server/sources/datafeed.py --- a/server/sources/datafeed.py Tue Aug 02 17:37:55 2011 +0200 +++ b/server/sources/datafeed.py Wed Aug 03 18:16:02 2011 +0200 @@ -218,7 +218,7 @@ """ entity = super(DataFeedSource, self).before_entity_insertion( session, lid, etype, eid, sourceparams) - entity.cw_edited['cwuri'] = unicode(lid) + entity.cw_edited['cwuri'] = lid.decode('utf-8') entity.cw_edited.set_defaults() sourceparams['parser'].before_entity_copy(entity, sourceparams) return entity @@ -275,6 +275,8 @@ else: source = self.source sourceparams['parser'] = self + if isinstance(uri, unicode): + uri = uri.encode('utf-8') try: eid = session.repo.extid2eid(source, str(uri), etype, session, complete=False, commit=False,