Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXIF title only supports ascii characters when updating #27

Closed
jmathai opened this issue Dec 11, 2015 · 1 comment
Closed

EXIF title only supports ascii characters when updating #27

jmathai opened this issue Dec 11, 2015 · 1 comment

Comments

@jmathai
Copy link
Owner

jmathai commented Dec 11, 2015

Marking a test as skipped for this by adding # -*- coding: utf-8 to the top of the file.

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/Users/jmathai/elodie/elodie/tests/media/photo.py", line 168, in test_set_title_non_ascii
    status = photo.set_title('形声字 / 形聲字')
  File "/Users/jmathai/elodie/elodie/media/photo.py", line 165, in set_title
    exif_metadata['Xmp.dc.title'] = title
  File "/usr/local/lib/python2.7/site-packages/pyexiv2/metadata.py", line 271, in __setitem__
    return getattr(self, '_set_%s_tag' % family)(key, tag_or_value)
  File "/usr/local/lib/python2.7/site-packages/pyexiv2/metadata.py", line 244, in _set_xmp_tag
    tag = XmpTag(key, tag_or_value)
  File "/usr/local/lib/python2.7/site-packages/pyexiv2/xmp.py", line 114, in __init__
    self._set_value(value)
  File "/usr/local/lib/python2.7/site-packages/pyexiv2/xmp.py", line 235, in _set_value
    raw_value[k.encode('utf-8')] = v.encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 0: ordinal not in range(128)
@noonat
Copy link
Contributor

noonat commented Jan 11, 2016

It looks like it's actually encoding it as utf-8, which is the correct behavior, but I think you need to mark your test string as unicode to get the correct behavior.

noonat added a commit to noonat/elodie that referenced this issue Jan 11, 2016
jmathai added a commit that referenced this issue Jan 11, 2016
@jmathai jmathai closed this as completed Feb 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants