Use a wrapper around xml.etree.ElementTree.fromstring in python 2.x (#7178)

Attributes aren't unicode objects, so they couldn't be directly used in info_dict fields (for example '--write-description' doesn't work with bytes).
This commit is contained in:
Jaime Marquínez Ferrándiz 2015-10-25 20:04:55 +01:00
parent 755ff8d22c
commit 36e6f62cd0
11 changed files with 61 additions and 21 deletions

View file

@ -36,6 +36,7 @@ import zlib
from .compat import (
compat_basestring,
compat_chr,
compat_etree_fromstring,
compat_html_entities,
compat_http_client,
compat_kwargs,
@ -1974,7 +1975,7 @@ def dfxp2srt(dfxp_data):
return out
dfxp = xml.etree.ElementTree.fromstring(dfxp_data.encode('utf-8'))
dfxp = compat_etree_fromstring(dfxp_data.encode('utf-8'))
out = []
paras = dfxp.findall(_x('.//ttml:p')) or dfxp.findall(_x('.//ttaf1:p')) or dfxp.findall('.//p')