Skip to content

Instantly share code, notes, and snippets.

@mmccollow
Created February 23, 2012 21:26
Show Gist options
  • Save mmccollow/1895144 to your computer and use it in GitHub Desktop.
Save mmccollow/1895144 to your computer and use it in GitHub Desktop.
unicode
[...]
map_label = mods_tree.xpath("*[local-name() = 'titleInfo']/*[local-name() = 'title']/text()")
map_label = unicode(map_label[0].strip("\t\n\r"), encoding='utf-8')
[...]
map_pid = fedora.getNextPID(name_space)
map_object = fedora.createObject(map_pid, label = map_label.encode('utf-8'))
----------
Traceback (most recent call last):
File "./scw_ingest.py", line 153, in <module>
map_object = fedora.createObject(map_pid, label = map_label.encode('utf-8'))
File "/usr/lib/python2.6/site-packages/fcrepo-1.1_dev-py2.6.egg/fcrepo/client.py", line 50, in createObject
response = request.submit(body, state=state[0], label=label)
File "/usr/lib/python2.6/site-packages/fcrepo-1.1_dev-py2.6.egg/fcrepo/wadl.py", line 65, in submit
value.__class__))
TypeError: Expected <type 'unicode'> for param "label" on method "createObject", got <type 'str'> instead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment