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':
|
||||
try:
|
||||
data = data.encode(response.encoding)
|
||||
except LookupError:
|
||||
except (LookupError, UnicodeEncodeError):
|
||||
pass
|
||||
|
||||
if data:
|
||||
|
|
|
@ -64,7 +64,7 @@ class TextImporter:
|
|||
if resp.encoding and resp.encoding != 'utf-8':
|
||||
try:
|
||||
text = text.encode(resp.encoding)
|
||||
except LookupError:
|
||||
except (LookupError, UnicodeEncodeError):
|
||||
pass
|
||||
|
||||
if text:
|
||||
|
|
11
fabfile.py
vendored
11
fabfile.py
vendored
|
@ -505,6 +505,17 @@ def pip():
|
|||
run('pip install --upgrade pip')
|
||||
run('pip install -r requirements.txt')
|
||||
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.
|
||||
def setup_imaging():
|
||||
|
|
Loading…
Add table
Reference in a new issue