Cryptic error in lxml when opening file
<p>My code is rather simple; </p>

<pre><code>f = open(r"C:\filepath\file.xml")
xml = f.read()
tree = etree.parse(xml)
</code></pre>

<p>When running this, I get the stack trace </p>

<pre><code>tree = etree.parse(xml)
  File "src/lxml/lxml.etree.pyx", line 3427, in lxml.etree.parse (src\lxml\lxml.etree.c:79801)
  File "src/lxml/parser.pxi", line 1782, in lxml.etree._parseDocument (src\lxml\lxml.etree.c:115995)
  File "src/lxml/parser.pxi", line 1808, in lxml.etree._parseDocumentFromURL (src\lxml\lxml.etree.c:116345)
  File "src/lxml/parser.pxi", line 1712, in lxml.etree._parseDocFromFile (src\lxml\lxml.etree.c:115233)
  File "src/lxml/parser.pxi", line 1115, in lxml.etree._BaseParser._parseDocFromFile (src\lxml\lxml.etree.c:109930)
  File "src/lxml/parser.pxi", line 573, in lxml.etree._ParserContext._handleParseResultDoc (src\lxml\lxml.etree.c:103404)
  File "src/lxml/parser.pxi", line 683, in lxml.etree._handleParseResult (src\lxml\lxml.etree.c:105058)
  File "src/lxml/parser.pxi", line 611, in lxml.etree._raiseParseError (src\lxml\lxml.etree.c:103924)
IOError
</code></pre>

<p>What's going on here? </p>