[Python-checkins] cpython (merge 3.4 -> default): merge with 3.4
georg.brandl
python-checkins at python.org
Thu Nov 6 15:33:48 CET 2014
https://hg.python.org/cpython/rev/a688d3206646
changeset: 93420:a688d3206646
parent: 93416:124e9547cb36
parent: 93419:540b022ae7a9
user: Georg Brandl <georg at python.org>
date: Thu Nov 06 15:33:35 2014 +0100
summary:
merge with 3.4
files:
Lib/test/support/__init__.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -1029,7 +1029,12 @@
requires('urlfetch')
print('\tfetching %s ...' % url, file=get_original_stdout())
- f = urllib.request.urlopen(url, timeout=15)
+ opener = urllib.request.build_opener()
+ if gzip:
+ opener.addheaders.append(('Accept-Encoding', 'gzip'))
+ f = opener.open(url, timeout=15)
+ if gzip and f.headers.get('Content-Encoding') == 'gzip':
+ f = gzip.GzipFile(fileobj=f)
try:
with open(fn, "wb") as out:
s = f.read()
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list