Closes issue11563 test_urllibnet is triggering a ResourceWarning. Patch by Jeff McNeil.

This commit is contained in:
Senthil Kumaran 2011-03-19 17:47:26 +08:00
commit a4d5b0cb62
2 changed files with 12 additions and 1 deletions

View file

@ -1657,6 +1657,12 @@ class URLopener:
headers["Authorization"] = "Basic %s" % auth
if realhost:
headers["Host"] = realhost
# Add Connection:close as we don't support persistent connections yet.
# This helps in closing the socket and avoiding ResourceWarning
headers["Connection"] = "close"
for header, value in self.addheaders:
headers[header] = value