[Python-checkins] CVS: python/dist/src/Lib/xml/sax saxutils.py,1.7,1.8
Fred L. Drake
python-dev@python.org
Tue, 26 Sep 2000 10:23:25 -0700
- Previous message: [Python-checkins] CVS: python/dist/src configure,1.155,1.156
- Next message: [Python-checkins] CVS: python/dist/src/Lib/dos-8x3 cgihttps.py,1.8,1.9 configpa.py,1.8,1.9 posixfil.py,1.9,1.10 py_compi.py,1.9,1.10 sre_pars.py,1.6,1.7 stringio.py,1.4,1.5 test_arr.py,1.8,1.9 test_cpi.py,1.2,1.3 test_exc.py,1.5,1.6 test_fcn.py,1.7,1.8 test_gra.py,1.4,1.5 test_min.py,1.1,1.2 test_pic.py,1.1,1.2 test_pye.py,1.2,1.3 test_rfc.py,1.2,1.3 test_str.py,1.10,1.11 test_url.py,1.1,1.2 test_win.py,1.3,1.4 userlist.py,1.8,1.9 webbrows.py,1.2,1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Lib/xml/sax
In directory slayer.i.sourceforge.net:/tmp/cvs-serv26794/Lib/xml/sax
Modified Files:
saxutils.py
Log Message:
Fix handling of file inputs on Windows; passing them to urllib.urlopen()
caused the drive letter to cause urlopen() to think it was an unrecognized
URL scheme. This only passes system ids to urlopen() if the file does not
exist. It works on Windows & Unix.
It should work everywhere else as well.
Index: saxutils.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/xml/sax/saxutils.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** saxutils.py 2000/09/24 21:31:06 1.7
--- saxutils.py 2000/09/26 17:23:09 1.8
***************
*** 199,211 ****
source.setByteStream(f)
! if source.getByteStream() == None:
sysid = source.getSystemId()
! if urlparse.urlparse(sysid)[0] == '':
basehead = os.path.split(os.path.normpath(base))[0]
source.setSystemId(os.path.join(basehead, sysid))
else:
source.setSystemId(urlparse.urljoin(base, sysid))
! source.setByteStream(urllib.urlopen(source.getSystemId()))
return source
--- 199,213 ----
source.setByteStream(f)
! if source.getByteStream() is None:
sysid = source.getSystemId()
! if os.path.isfile(sysid):
basehead = os.path.split(os.path.normpath(base))[0]
source.setSystemId(os.path.join(basehead, sysid))
+ f = open(sysid, "rb")
else:
source.setSystemId(urlparse.urljoin(base, sysid))
+ f = urllib.urlopen(source.getSystemId())
! source.setByteStream(f)
return source
- Previous message: [Python-checkins] CVS: python/dist/src configure,1.155,1.156
- Next message: [Python-checkins] CVS: python/dist/src/Lib/dos-8x3 cgihttps.py,1.8,1.9 configpa.py,1.8,1.9 posixfil.py,1.9,1.10 py_compi.py,1.9,1.10 sre_pars.py,1.6,1.7 stringio.py,1.4,1.5 test_arr.py,1.8,1.9 test_cpi.py,1.2,1.3 test_exc.py,1.5,1.6 test_fcn.py,1.7,1.8 test_gra.py,1.4,1.5 test_min.py,1.1,1.2 test_pic.py,1.1,1.2 test_pye.py,1.2,1.3 test_rfc.py,1.2,1.3 test_str.py,1.10,1.11 test_url.py,1.1,1.2 test_win.py,1.3,1.4 userlist.py,1.8,1.9 webbrows.py,1.2,1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]