backport-1.8-3923

backport  #3923: `BUG: close file-like objects returned by urlopen`