mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 11:02:21 -05:00
download_file helper function now decodes unicode on the fly
This commit is contained in:
parent
ef9334fa6a
commit
76062ae2a7
@ -1207,7 +1207,7 @@ def download_file(url, filename, session=None):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
with open(filename, 'wb') as fp:
|
with open(filename, 'wb') as fp:
|
||||||
for chunk in resp.iter_content(chunk_size=1024):
|
for chunk in resp.iter_content(chunk_size=1024, decode_unicode=True):
|
||||||
if chunk:
|
if chunk:
|
||||||
fp.write(chunk)
|
fp.write(chunk)
|
||||||
fp.flush()
|
fp.flush()
|
||||||
|
@ -21,11 +21,11 @@ from __future__ import with_statement
|
|||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import sys, os.path
|
import sys, os.path
|
||||||
import urlparse
|
|
||||||
|
|
||||||
sys.path.append(os.path.abspath('..'))
|
sys.path.append(os.path.abspath('..'))
|
||||||
sys.path.append(os.path.abspath('../lib'))
|
sys.path.append(os.path.abspath('../lib'))
|
||||||
|
|
||||||
|
import urlparse
|
||||||
import test_lib as test
|
import test_lib as test
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
from sickbeard.helpers import getURL
|
from sickbeard.helpers import getURL
|
||||||
|
Loading…
Reference in New Issue
Block a user