[Python-checkins] cpython (3.4): Issue #23526: Fix ResourceWarning in test_httplib. Patch written by Alex Shkop.

victor.stinner python-checkins at python.org
Fri Feb 27 17:47:48 CET 2015


https://hg.python.org/cpython/rev/056d71d7bb28
changeset:   94771:056d71d7bb28
branch:      3.4
parent:      94769:d0e15d9cdd4b
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Fri Feb 27 17:47:23 2015 +0100
summary:
  Issue #23526: Fix ResourceWarning in test_httplib. Patch written by Alex Shkop.

files:
  Lib/test/test_httplib.py |  3 +++
  Misc/ACKS                |  1 +
  2 files changed, 4 insertions(+), 0 deletions(-)


diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py
--- a/Lib/test/test_httplib.py
+++ b/Lib/test/test_httplib.py
@@ -840,6 +840,7 @@
                                        context=context)
             h.request('GET', '/')
             resp = h.getresponse()
+            h.close()
             self.assertIn('nginx', resp.getheader('server'))
 
     @support.system_must_validate_cert
@@ -851,6 +852,7 @@
             h.request('GET', '/')
             resp = h.getresponse()
             content_type = resp.getheader('content-type')
+            h.close()
             self.assertIn('text/html', content_type)
 
     def test_networked_good_cert(self):
@@ -865,6 +867,7 @@
             h.request('GET', '/')
             resp = h.getresponse()
             server_string = resp.getheader('server')
+            h.close()
             self.assertIn('nginx', server_string)
 
     def test_networked_bad_cert(self):
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1247,6 +1247,7 @@
 Pete Shinners
 Michael Shiplett
 John W. Shipman
+Alex Shkop
 Joel Shprentz
 Yue Shuaijie
 Terrel Shumway

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list