title: Why vertical tab is not escaped by ElementTree in python 3.5?
body: <p>I'm converting some text data to xml and use <code>xml.etree.ElementTree</code> to do so. Also I need to output pretty xml so I use <a href="https://stackoverflow.com/a/1206856/1948038">this answer</a>. </p>
  
  <p>But my data contains some strange symbols like vertical tab (<code>\v</code> or <code>\x0b</code>). And when I convert my xml to string it is not escaped (which I suppose produces invalid xml) and then when I try to reparse it to pretty print it fails.</p>
  
  <p>Here is the code example</p>
  
  <pre class="lang-py prettyprint-override"><code>import xml.etree.ElementTree as ET
  import xml.dom.minidom as MD
  
  root = ET.Element("root")
  root.text = "some &lt;&lt;&gt;&gt; text \v other text"
  
  rough_string = ET.tostring(root, 'utf-8')
  reparsed = MD.parseString(rough_string)
  </code></pre>
  
  <p>Here <code>rough_string</code> contains following <code>&lt;root&gt;some &amp;lt;&amp;lt;&amp;gt;&amp;gt; text  other text&lt;/root&gt;</code>. It did escape the &lt;&lt;>> but missed the \v.</p>
  
  <p>While if I do same on .NET it do escape it</p>
  
  <pre class="lang-cs prettyprint-override"><code>XmlDocument doc = new XmlDocument();    
  XmlElement priceElement = doc.CreateElement("root");
  priceElement.InnerText = "some &lt;&lt;&gt;&gt; text \v other text";
  doc.AppendChild(priceElement);  
  string res = doc.OuterXml;
  </code></pre>
  
  <p>Result is <code>&lt;root&gt;some &amp;lt;&amp;lt;&amp;gt;&amp;gt; text &amp;#xB; other text&lt;/root&gt;</code>.</p>
  
  <p>Is this a bug in ElementTree? How can I solve this issue?</p>
  
  <p>UPDATE: Seems that the behavior of both ElementTree and .NET <a href="https://stackoverflow.com/questions/8386970/best-practice-for-handling-vertical-tabs-and-other-invalid-xml-characters">is incorrect</a> as was pointed in comments. But how should I handle this? If these are some really tricky chars I could just remove them from the source string (I do not have very strict requirements for this), but I need to know the full list of such chars, where could I find one?</p>