]> granicus.if.org Git - python/commitdiff
Explicitly use UTF-8 as the encoding for the normalization file.
authorMartin v. Löwis <martin@v.loewis.de>
Thu, 30 Aug 2007 20:58:02 +0000 (20:58 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Thu, 30 Aug 2007 20:58:02 +0000 (20:58 +0000)
Lib/test/test_normalization.py
Lib/test/test_support.py

index f07a87d1541bc658ef93e38b6c21919bec3c2638..ae49996bafd814467872bf4bfe626cc979673090 100644 (file)
@@ -33,7 +33,7 @@ def unistr(data):
 class NormalizationTest(unittest.TestCase):
     def test_main(self):
         part1_data = {}
-        for line in open_urlresource(TESTDATAURL):
+        for line in open_urlresource(TESTDATAURL, encoding="utf-8"):
             if '#' in line:
                 line = line.split('#')[0]
             line = line.strip()
index 99f57e6071fa551f8d5ead7710b3e450dc39bf09..637043d8461c69a4fe824f24ccbef883d04df225 100644 (file)
@@ -244,7 +244,7 @@ def check_syntax_error(testcase, statement):
     else:
         testcase.fail('Missing SyntaxError: "%s"' % statement)
 
-def open_urlresource(url):
+def open_urlresource(url, *args, **kw):
     import urllib, urlparse
 
     requires('urlfetch')
@@ -253,11 +253,11 @@ def open_urlresource(url):
     for path in [os.path.curdir, os.path.pardir]:
         fn = os.path.join(path, filename)
         if os.path.exists(fn):
-            return open(fn)
+            return open(fn, *args, **kw)
 
     print('\tfetching %s ...' % url, file=get_original_stdout())
     fn, _ = urllib.urlretrieve(url, filename)
-    return open(fn)
+    return open(fn, *args, **kw)
 
 
 class WarningMessage(object):