AcademySoftwareFoundation / OpenTimelineIO

Open Source API and interchange format for editorial timeline information.
http://opentimeline.io
Apache License 2.0
1.47k stars 294 forks source link

rv_session adapter does not handle unicode metadata #1265

Open avrata opened 2 years ago

avrata commented 2 years ago

Bug Report

Incorrect Functionality and General Questions

While using the rv_session adapter, we noticed that if we have unicode data in metadata, the adapter will fail with an error like:

<otio_locatio>/lib/python2.7/site-packages/opentimelineio_contrib/adapters/rv.pyc in _write_item(it, to_session, track_kind)
    388                 "rvSession.gto.STRING",
    389                 # Serialize to a string as it seems gto has issues with unicode
--> 390                 str(otio.core.serialize_json_to_string(it.metadata, indent=-1))
    391             ]
    392         )

UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 913: ordinal not in range(128)

To Reproduce

  1. Operating System: linux
  2. Python version: 2.7
  3. OpenTimelineIO release version or commit hash: 71aa2fa57c5498c7615d6a82e0d943e749577728

Expected Behavior

We should be able to encode unicode metadata in the rv session.

Additional Context

I'll test python 3 once I get past https://github.com/PixarAnimationStudios/OpenTimelineIO/issues/1264. I'll also need to test the rv plugin example as well.

reinecke commented 2 years ago

@avrata Did #1267 fix this issue too?