When group names or username contains special characters export will fail with python 2.7 One solution would be to use urllib.quote(p['userName'].encode('utf-8'))) instead of urllib.quote(unicode(p['userName']))) in alfresco.py