소스 검색

elementtree in Python 2.x would rather receive encoded strings.

Lukasz Langa 14 년 전
부모
커밋
b230601ee2
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      radicale/xmlutils.py

+ 3 - 3
radicale/xmlutils.py

@@ -119,7 +119,7 @@ def propfind(path, xml_request, calendar, depth):
 
     """
     # Reading request
-    root = ET.fromstring(xml_request)
+    root = ET.fromstring(xml_request.encode("utf8"))
 
     prop_element = root.find(_tag("D", "prop"))
     props = [prop.tag for prop in prop_element]
@@ -220,7 +220,7 @@ def proppatch(path, xml_request, calendar):
 
     """
     # Reading request
-    root = ET.fromstring(xml_request)
+    root = ET.fromstring(xml_request.encode("utf8"))
     props = []
 
     for action in ("set", "remove"):
@@ -274,7 +274,7 @@ def report(path, xml_request, calendar):
 
     """
     # Reading request
-    root = ET.fromstring(xml_request)
+    root = ET.fromstring(xml_request.encode("utf8"))
 
     prop_element = root.find(_tag("D", "prop"))
     props = [prop.tag for prop in prop_element]