SF bug #902037: relative on-disk SYSTEM id handling is incorrect
(Contributed by Bob Ippolito.) backport candidate.
This commit is contained in:
parent
e54e726f0b
commit
06d9b1f30b
|
@ -283,10 +283,11 @@ def prepare_input_source(source, base = ""):
|
||||||
|
|
||||||
if source.getByteStream() is None:
|
if source.getByteStream() is None:
|
||||||
sysid = source.getSystemId()
|
sysid = source.getSystemId()
|
||||||
if os.path.isfile(sysid):
|
|
||||||
basehead = os.path.split(os.path.normpath(base))[0]
|
basehead = os.path.split(os.path.normpath(base))[0]
|
||||||
source.setSystemId(os.path.join(basehead, sysid))
|
sysidfilename = os.path.join(basehead, sysid)
|
||||||
f = open(sysid, "rb")
|
if os.path.isfile(sysidfilename):
|
||||||
|
source.setSystemId(sysidfilename)
|
||||||
|
f = open(sysidfilename, "rb")
|
||||||
else:
|
else:
|
||||||
source.setSystemId(urlparse.urljoin(base, sysid))
|
source.setSystemId(urlparse.urljoin(base, sysid))
|
||||||
f = urllib.urlopen(source.getSystemId())
|
f = urllib.urlopen(source.getSystemId())
|
||||||
|
|
Loading…
Reference in New Issue