[XML-SIG] [ pyxml-Bugs-567411 ] Can't find system entity (Win32 only)
noreply@sourceforge.net
noreply@sourceforge.net
Tue, 11 Jun 2002 07:21:56 -0700
Bugs item #567411, was opened at 2002-06-11 07:21
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=106473&aid=567411&group_id=6473
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Can't find system entity (Win32 only)
Initial Comment:
Hi,
When parsing (SAX) an XML file that calls a system
entity with the following code, it works perfectly in a
Linux box, but it raises an IOError in urllib in a Windows
box.
===main.xml===
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE profil SYSTEM "mydoctype.dtd" [
<!ENTITY list_usage.xml SYSTEM "list_usage.xml">
]>
<stuff>
...
&list_usage.xml;
...
</stuff>
===/main.xml===
===list_usage.xml===
<?xml version="1.0" encoding="ISO-8859-1"?>
<foo>
...
</foo>
===/list_usage.xml===
===myscript.py===
...
from xml.sax import make_parser
from xml.sax.handler import feature_external_ges
p = make_parser(["xml.sax.drivers2.drv_xmlproc_val"])
p.setFeature(feature_external_ges,1)
dh = MyHandler()
p.setContentHandler(dh)
# Crash hereafter
p.parse(xmlfile)
...
===/myscript.py===
===Traceback===
...
File C:\PYTHON21\_xmlplus\sax\expatreader.py, line
109, in parse
File C:\PYTHON21\_xmlplus\sax\xmlreader.py, line
123, in parse
File C:\PYTHON21\_xmlplus\sax\expatreader.py, line
203, in feed
File C:\PYTHON21\_xmlplus\sax\expatreader.py, line
337, in external_entity_ref
File C:\PYTHON21\_xmlplus\sax\saxutils.py, line 460,
in prepare_input_source
File C:\PYTHON21\lib\urllib.py, line 71, in urlopen
File C:\PYTHON21\lib\urllib.py, line 176, in open
File C:\PYTHON21\lib\urllib.py, line 400, in open_file
File C:\PYTHON21\lib\urllib.py, line 413, in
open_local_file
IOError: (see above)
===/Traceback===
My Windows configuration :
Win98 2e + Python 2.1.3 + pyXML 0.7.1 (binary)
My Linux configuration :
Debian 2.2 + Python 2.1.3 (source distro) + pyXML
0.7.1 (source distro)
In both cases, the xml file is parsed from the local file
system.
another "strange" thing : the parser finds the DTD but
not the system entities (all in the same directory).
Linux : /home/glt/xresources/main.xml
Windows : C:\Mes Documents\xresources\main.xml
Don't hesitate to contact me if you need more
information.
Sincerely.
--Gilles
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=106473&aid=567411&group_id=6473