parsing from network fails after etree.fromstring()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Fix Released
|
Medium
|
scoder |
Bug Description
Calling etree.fromstring() without a parser uses the global default parser and appears to set that parser to no-network mode. Calling etree.parse() without a parser uses that same global default parser, now in no-network mode. Trying to use it to parse an http url thus fails after a cal to etree.fromstring(). Here's the output I get from the attached script:
Traceback (most recent call last):
File "lxml-error.py", line 5, in <module>
etree.parse('http://
File "lxml.etree.pyx", line 2706, in lxml.etree.parse (src/lxml/
File "parser.pxi", line 1500, in lxml.etree.
File "parser.pxi", line 1529, in lxml.etree.
File "parser.pxi", line 1429, in lxml.etree.
File "parser.pxi", line 975, in lxml.etree.
File "parser.pxi", line 539, in lxml.etree.
File "parser.pxi", line 625, in lxml.etree.
File "parser.pxi", line 565, in lxml.etree.
lxml.etree.
%%
Python : (2, 6, 5, 'final', 0)
lxml.etree : (2, 2, 7, 0)
libxml used : (2, 7, 6)
libxml compiled : (2, 7, 6)
libxslt used : (1, 1, 26)
libxslt compiled : (1, 1, 26)
summary: |
- etree.parse() fails after etree.fromstring() + parsing from network fails after etree.fromstring() |
Changed in lxml: | |
milestone: | none → 3.2 |
I can reproduce this with the latest trunk.