Python 2.6.1 : expected path separator ([)
<p>I am getting a path separator error in python 2.6.1. I have not found this issue with python 2.7.2 version, but unfortunately I need this in 2.6.1 only. Is there any another way to achieve the same? :(</p>

<p>my code :-</p>

<pre><code>import xml.etree.ElementTree as ET #version 1.2.6
import sys   

class usersDetail(object): 

    def __init__(self, users=None):
        self.doc = ET.parse("test.xml")
        self.root = self.doc.getroot()

    def final_xml(self,username):
        r = self.root.find("user[@username='user1']") #not working in 2.6.1 :(
        self.root.remove(r)
        print r
        tree = ET.ElementTree(self.root)
        tree.write("msl.xml") 

if __name__ == '__main__':
    parser = usersDetail()
    parser.final_xml("user1") 
</code></pre>

<p>test.xml is :-</p>

<pre><code>&lt;?xml version="1.0"?&gt;
&lt;users&gt;
&lt;user afp="yes" cifs="yes"  username="user1" volume="vol" webdev="yes" /&gt;&lt;/user&gt;
&lt;/users&gt;
</code></pre>

<p>What this will do is it will remove the xml only if username = username. Thanks in advance for your valuable time.</p>
