correctly fix the problem with streamed calls on requests (closes #1683)

Do not close explicitly the socket, as it is closed automatically when all
the data is consumed.
This commit is contained in:
Romain Bignon 2014-12-10 11:29:05 +01:00
commit 9d1155955e
3 changed files with 2 additions and 6 deletions

View file

@ -80,7 +80,6 @@ class CanalplusBrowser(Browser):
def read_url(self, url):
r = requests.get(url, stream=True)
buf = r.iter_lines()
r.close()
return [line for line in buf if not line.startswith('#')]
def iter_resources(self, split_path):

View file

@ -47,7 +47,6 @@ class PluzzBrowser(PagesBrowser):
def read_url(self, url):
r = self.open(url, stream=True)
buf = r.iter_lines()
r.close()
return buf
def latest_videos(self):

View file

@ -121,10 +121,8 @@ class Videoob(ReplApplication):
os.spawnlp(os.P_WAIT, args[0], *args)
def read_url(self, url):
r = requests.get(url, stream=False)
buf = r.iter_lines()
r.close()
return buf
r = requests.get(url, stream=True)
return r.iter_lines()
def complete_download(self, text, line, *ignored):
args = line.split(' ')