You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.
I was using a python 2.7 virtualenv and the ipynb plugin for converting jupyter notebooks to html with pelican.
With some .ipynb notebooks (python 2.7 kernel) in the pelican content folder I tried running pelican content. I was receiving the error "UnicodeDecodeError: 'ascii' codec can't decade byte 0xc2 in position 333: ordinal not in range(128)." The error only occurred for jupyter notebooks that had code cells in them, the pure markdown notebooks were fine.
I found this SO question and added the following at the top of the pelicanconf.py file under from __future__ import __unicode_literals :
ERROR: Could not process posts/object_classes/interfaces.ipynb
| UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 87400: ordinal not in range(128)
@sdsawtelle solution fixed the problem for me, too. Thanks!
from __future__ import __unicode_literals
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
Thank you so much for this, for some reason this issue never came up in my google searches, only when I combed the issues here directly (lesson learned).
I was using a python 2.7 virtualenv and the ipynb plugin for converting jupyter notebooks to html with pelican.
With some .ipynb notebooks (python 2.7 kernel) in the pelican content folder I tried running
pelican content
. I was receiving the error "UnicodeDecodeError: 'ascii' codec can't decade byte 0xc2 in position 333: ordinal not in range(128)." The error only occurred for jupyter notebooks that had code cells in them, the pure markdown notebooks were fine.I found this SO question and added the following at the top of the
pelicanconf.py
file under from__future__ import __unicode_literals
:import sys
reload(sys)
sys.setdefaultencoding("utf-8")
This seems to have fixed the issue, but I don't really understand why.
Also sorry if this is the wrong place to be logging this. I'm a noob.
EDIT: added link to SO question.
The text was updated successfully, but these errors were encountered: