title: ValueError: unsupported format character ']' (0x5d)
body: <p>I'm trying to make irc bot with python. The bot will parse XML and paste its content on channel. This is part of my code</p>
  <pre><code>f = open(&quot;1.xml&quot;)
  data = f.read()
  f.close()
  domi = parseString(data)
  attackerbartag = domi.getElementsByTagName('bar')[0].toxml()
  attackerbar = attackerbartag.replace('&lt;bar&gt;','').replace('&lt;/bar&gt;','')
  attackerbar = round(float(attackerbar)2)
  defenderbar = 100 - attackerbar
  
  attackertag = domi.getElementsByTagName('name')[1].toxml()
  attacker = attackertag.replace('&lt;name&gt;','').replace('&lt;/name&gt;','')
  
  defendertag = domi.getElementsByTagName('name')[42].toxml()
  defender = defendertag.replace('&lt;name&gt;','').replace('&lt;/name&gt;','')
  
  attackerpointtag = domi.getElementsByTagName('points')[1].toxml()
  attackerpoint = attackerpointtag.replace('&lt;points&gt;','').replace('&lt;/points&gt;','')
  
  defenderpointtag = domi.getElementsByTagName('points')[6].toxml()
  defenderpoint = defenderpointtag.replace('&lt;points&gt;','').replace('&lt;/points&gt;','')
  
  attackerdomtag = domi.getElementsByTagName('domination')[0].toxml()
  attackerdom = attackerdomtag.replace('&lt;domination&gt;','').replace('&lt;/domination&gt;','')
  
  defenderdomtag = domi.getElementsByTagName('domination')[4].toxml()
  defenderdom = defenderdomtag.replace('&lt;domination&gt;','').replace('&lt;/domination&gt;','')
  
  result = 'Div.1 :: %s [ %s p ] [ %s% ] [ %s Dom ] &lt;--&gt; [ %s Dom ] [ %s% ] [ %s p ] %s ::' % (attacker, attackerpoint, attackerbar, attackerdom, defenderdom, defenderbar, defenderpoint, defender)
  return result
  </code></pre>
  <p>and I got <code>ValueError: unsupported format character ']' (0x5d).</code></p>
  <p>I'm pretty sure I already close all [ ]</p>
  <p>I tried change [ ] with () and the error is <code>ValueError: unsupported format character ')' (0x5d)</code></p>
  <p>Can anyone show me where I made a boo boo ?
  Thank you</p>