summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllibnet.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2008-03-26 04:23:27 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2008-03-26 04:23:27 (GMT)
commit6ae6ad82fcb30e7b408cf0625b2048218ebe2b25 (patch)
tree9ec5ee0fb278340ccdb2a5b5358cb8dc343de424 /Lib/test/test_urllibnet.py
parent548de7772519a95c5ad7c48d7debbd317dc5a43b (diff)
downloadcpython-6ae6ad82fcb30e7b408cf0625b2048218ebe2b25.zip
cpython-6ae6ad82fcb30e7b408cf0625b2048218ebe2b25.tar.gz
cpython-6ae6ad82fcb30e7b408cf0625b2048218ebe2b25.tar.bz2
Get the test to pass on space Ubuntu/Debian and ppc. It was failing
to decode 'Journ\xc3\xa9es Python' as ASCII.
Diffstat (limited to 'Lib/test/test_urllibnet.py')
-rw-r--r--Lib/test/test_urllibnet.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py
index e9f1fea..6fd4684 100644
--- a/Lib/test/test_urllibnet.py
+++ b/Lib/test/test_urllibnet.py
@@ -121,7 +121,10 @@ class urlopenNetworkTests(unittest.TestCase):
# Make sure fd returned by fileno is valid.
open_url = self.urlopen("http://www.python.org/")
fd = open_url.fileno()
+ # XXX(nnorwitz): There is currently no way to pass errors, encoding,
+ # etc to fdopen. :-(
FILE = os.fdopen(fd)
+ FILE._errors = 'ignore'
try:
self.assert_(FILE.read(), "reading from file created using fd "
"returned by fileno failed")
@@ -152,7 +155,7 @@ class urlretrieveNetworkTests(unittest.TestCase):
file_location,info = self.urlretrieve("http://www.python.org/")
self.assert_(os.path.exists(file_location), "file location returned by"
" urlretrieve is not a valid path")
- FILE = open(file_location)
+ FILE = open(file_location, errors='ignore')
try:
self.assert_(FILE.read(), "reading from the file location returned"
" by urlretrieve failed")
@@ -166,7 +169,7 @@ class urlretrieveNetworkTests(unittest.TestCase):
test_support.TESTFN)
self.assertEqual(file_location, test_support.TESTFN)
self.assert_(os.path.exists(file_location))
- FILE = open(file_location)
+ FILE = open(file_location, errors='ignore')
try:
self.assert_(FILE.read(), "reading from temporary file failed")
finally: