mirror of
https://github.com/viq/NewsBlur.git
synced 2025-08-05 16:49:45 +00:00
Handling unicode encode errors in page/text handling. Also adding upgrade command for fabric when pip is non-trivial.
This commit is contained in:
parent
9c463ea264
commit
c4830e3e95
3 changed files with 13 additions and 2 deletions
|
@ -193,7 +193,7 @@ class PageImporter(object):
|
||||||
if response.encoding and response.encoding != 'utf-8':
|
if response.encoding and response.encoding != 'utf-8':
|
||||||
try:
|
try:
|
||||||
data = data.encode(response.encoding)
|
data = data.encode(response.encoding)
|
||||||
except LookupError:
|
except (LookupError, UnicodeEncodeError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if data:
|
if data:
|
||||||
|
|
|
@ -64,7 +64,7 @@ class TextImporter:
|
||||||
if resp.encoding and resp.encoding != 'utf-8':
|
if resp.encoding and resp.encoding != 'utf-8':
|
||||||
try:
|
try:
|
||||||
text = text.encode(resp.encoding)
|
text = text.encode(resp.encoding)
|
||||||
except LookupError:
|
except (LookupError, UnicodeEncodeError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if text:
|
if text:
|
||||||
|
|
11
fabfile.py
vendored
11
fabfile.py
vendored
|
@ -506,6 +506,17 @@ def pip():
|
||||||
run('pip install -r requirements.txt')
|
run('pip install -r requirements.txt')
|
||||||
sudo('swapoff /swapfile')
|
sudo('swapoff /swapfile')
|
||||||
|
|
||||||
|
def solo_pip(role):
|
||||||
|
if role == "app":
|
||||||
|
gunicorn_stop()
|
||||||
|
pip()
|
||||||
|
deploy_code(reload=True)
|
||||||
|
elif role == "task":
|
||||||
|
celery_stop()
|
||||||
|
copy_task_settings()
|
||||||
|
pip()
|
||||||
|
celery()
|
||||||
|
|
||||||
# PIL - Only if python-imaging didn't install through apt-get, like on Mac OS X.
|
# PIL - Only if python-imaging didn't install through apt-get, like on Mac OS X.
|
||||||
def setup_imaging():
|
def setup_imaging():
|
||||||
sudo('easy_install --always-unzip pil')
|
sudo('easy_install --always-unzip pil')
|
||||||
|
|
Loading…
Add table
Reference in a new issue