refine-client-py
refine-client-py copied to clipboard
commands list and export fail for projectnames containing unicode chars
project name: unicodé
export:
$ python2 ./refine.py --export 1774315430083
/usr/lib64/python2.7/urllib.py:1298: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
return ''.join(map(quoter, s))
Traceback (most recent call last):
File "./refine.py", line 108, in <module>
refine_project = main()
File "./refine.py", line 102, in main
export_project(project, options)
File "./refine.py", line 76, in export_project
output.writelines(project.export(export_format=export_format))
File "/home/felix/git/refine-client-py/google/refine/refine.py", line 432, in export
url = ('export-rows/' + urllib.quote(self.project_name()) + '.' +
File "/usr/lib64/python2.7/urllib.py", line 1298, in quote
return ''.join(map(quoter, s))
KeyError: u'\xe9'
list:
$ python2 ./refine.py --list
Traceback (most recent call last):
File "./refine.py", line 108, in <module>
refine_project = main()
File "./refine.py", line 93, in main
list_projects()
File "./refine.py", line 63, in list_projects
print('{0:>14}: {1}'.format(project_id, project_info['name']))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 6: ordinal not in range(128)
The OpenRefine GUI suggests project names without unicode chars but people are free to override the project name input field.