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:
parent
ed4e1a058c
commit
9d1155955e
3 changed files with 2 additions and 6 deletions
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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(' ')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue