PySvn
PySvn copied to clipboard
properties method failed when no props defined
Ask for properties on an element taht does ot have properties defined raise an AttributeError NoneType as no attribute findall
svn\common.py", line 197, in properties for p in target_elem.findall('property')] AttributeError: 'NoneType' object has no attribute 'findall'
Need to robustify I think
What's the status of this?
Perhaps a simple change like this?
diff --git a/svn/common.py b/svn/common.py
index e3dcda6..e6f7c76 100644
--- a/svn/common.py
+++ b/svn/common.py
@@ -157,8 +157,11 @@ class CommonClient(svn.common_base.CommonBase):
# query the proper list of this path
root = xml.etree.ElementTree.fromstring(result)
target_elem = root.find('target')
- property_names = [p.attrib["name"]
- for p in target_elem.findall('property')]
+ if target_elem is not None:
+ property_names = [p.attrib["name"]
+ for p in target_elem.findall('property')]
+ else:
+ property_names = []
# now query the content of each propery
property_dict = {}