]> granicus.if.org Git - python/commitdiff
Fix open_urlresource() to pass its arguments to open() when the resource is cached.
authorAlexandre Vassalotti <alexandre@peadrop.com>
Wed, 22 Jul 2009 00:19:57 +0000 (00:19 +0000)
committerAlexandre Vassalotti <alexandre@peadrop.com>
Wed, 22 Jul 2009 00:19:57 +0000 (00:19 +0000)
This fixes the failure of test_normalization on the Windows buildbots,
where the Normalization.txt file was read as a MBCS text file, instead
as a UTF-8 one.

Lib/test/support.py

index e11fbaed67e91b4be76d0817c2a0e3cfc3e148ca..04964a1095805d48ec8e2a0044c57e08e38d2f78 100644 (file)
@@ -455,7 +455,7 @@ def open_urlresource(url, *args, **kw):
 
     fn = os.path.join(os.path.dirname(__file__), "data", filename)
     if os.path.exists(fn):
-        return open(fn)
+        return open(fn, *args, **kw)
 
     print('\tfetching %s ...' % url, file=get_original_stdout())
     fn, _ = urllib.request.urlretrieve(url, fn)