decode yaml dumped data as utf-8 in edit plugin for PY2

Yaml doesn't return a true unicode string even with `allow_unicode`
passed to `safe_dump_all`.
This commit is contained in:
Johnny Robeson 2016-08-08 23:59:54 -04:00
parent 19240f3ba8
commit 47bddb394c

View file

@ -252,6 +252,8 @@ class EditPlugin(plugins.BeetsPlugin):
encoding='utf-8')
old_str = dump(old_data)
new.write(old_str)
if six.PY2:
old_str = old_str.decode('utf-8')
new.close()
# Loop until we have parseable data and the user confirms.