1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 02:52:20 -05:00

download_file helper function now decodes unicode on the fly

This commit is contained in:
echel0n 2014-12-20 09:59:28 -08:00
parent ef9334fa6a
commit 76062ae2a7
2 changed files with 2 additions and 2 deletions

View File

@ -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()

View File

@ -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