AcademySoftwareFoundation / AcademySoftwareFoundation/OpenTimelineIO
rv_session adapter does not handle unicode metadata
- Dominant language
- C++
- Stars
- 2k
- Forks
- 351
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 1
Description
## 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:
```
/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
4. 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.
Contributor guide
Research direction
Start in opentimelineio_contrib/adapters/rv.py at _write_item, around the metadata serialization shown in the traceback. Reproduce the failure with the reported Linux and Python 2.7 setup, then check the rv plugin example as noted in the issue. Done means unicode metadata can be written to an RV session without the UnicodeEncodeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100