I'm not familiar with the function mescat, but have you tried: data=request.SESSION.get('data') items=len(data[0]['head']) for j in range(items): print container.mescat(u'city: ') + data[0]['head'][j][5] return printed It might prefer the input string to be unicode. Gre7g