fix attribute error on error handling in xmlfile()
merge 3.2 branch into master