[Python-3000-checkins] r61921 - python/branches/py3k/Lib/test/test_urllibnet.py
neal.norwitz
python-3000-checkins at python.org
Wed Mar 26 05:23:27 CET 2008
Author: neal.norwitz
Date: Wed Mar 26 05:23:27 2008
New Revision: 61921
Modified:
python/branches/py3k/Lib/test/test_urllibnet.py
Log:
Get the test to pass on space Ubuntu/Debian and ppc. It was failing
to decode 'Journ\xc3\xa9es Python' as ASCII.
Modified: python/branches/py3k/Lib/test/test_urllibnet.py
==============================================================================
--- python/branches/py3k/Lib/test/test_urllibnet.py (original)
+++ python/branches/py3k/Lib/test/test_urllibnet.py Wed Mar 26 05:23:27 2008
@@ -121,7 +121,10 @@
# 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 @@
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 @@
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:
More information about the Python-3000-checkins
mailing list