2
0
Эх сурвалжийг харах

[utils] Apply 2.6 xpath craziness

This fixes ARD on 2.6
Philipp Hagemeister 11 жил өмнө
parent
commit
d74bebd502
1 өөрчлөгдсөн 3 нэмэгдсэн , 0 устгасан
  1. 3 0
      youtube_dl/utils.py

+ 3 - 0
youtube_dl/utils.py

@@ -305,6 +305,9 @@ def xpath_with_ns(path, ns_map):
 
 
 def xpath_text(node, xpath, name=None, fatal=False):
+    if sys.version_info < (2, 7):  # Crazy 2.6
+        xpath = xpath.encode('ascii')
+
     n = node.find(xpath)
     if n is None:
         if fatal: