diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2007-08-30 20:58:02 +0000 |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2007-08-30 20:58:02 +0000 |
commit | 3a3805f41eaa74271d7490199cad03f9262f5b68 (patch) | |
tree | 7821f00904ebabe8883ccb5416ed2f89f212931b /Lib/test | |
parent | 4b6b6eebf71c88064357e78193c942396b0b5a18 (diff) | |
download | cpython-3a3805f41eaa74271d7490199cad03f9262f5b68.tar.gz |
Explicitly use UTF-8 as the encoding for the normalization file.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_normalization.py | 2 | ||||
-rw-r--r-- | Lib/test/test_support.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_normalization.py b/Lib/test/test_normalization.py index f07a87d154..ae49996baf 100644 --- a/Lib/test/test_normalization.py +++ b/Lib/test/test_normalization.py @@ -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() diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 99f57e6071..637043d846 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -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): |