[Python-checkins] CVS: python/dist/src/Lib/test test_urllib2.py,1.2,1.3
Tim Peters
tim_one@users.sourceforge.net
Mon, 16 Jul 2001 13:49:51 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv31486/python/dist/src/Lib/test
Modified Files:
test_urllib2.py
Log Message:
This has never worked on Windows. Now it does. If it breaks on Unix now,
great, it's your turn to watch it fail for months <0.9 wink>.
Index: test_urllib2.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_urllib2.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** test_urllib2.py 2001/05/29 06:06:54 1.2
--- test_urllib2.py 2001/07/16 20:49:49 1.3
***************
*** 1,4 ****
--- 1,5 ----
from test_support import verify
import urllib2
+ import os
# A couple trivial tests
***************
*** 11,16 ****
verify(0)
! file_url = "file://%s" % urllib2.__file__
f = urllib2.urlopen(file_url)
buf = f.read()
f.close()
--- 12,22 ----
verify(0)
! # XXX Name hacking to get this to work on Windows.
! fname = os.path.abspath(urllib2.__file__).replace('\\', '/')
! if fname[1:2] == ":":
! fname = fname[2:]
! file_url = "file://%s" % fname
f = urllib2.urlopen(file_url)
+
buf = f.read()
f.close()