danielfrg / pelican-jupyter

Pelican plugin for blogging with Jupyter/IPython Notebooks
Apache License 2.0
423 stars 105 forks source link

Fix for attempting to encode already encoded strings #44

Closed FedericoV closed 8 years ago

FedericoV commented 8 years ago

Hi,

Thanks for the awesome plug in. Yesterday, when trying to push a change to my blog, I noticed an error. After debugging, what happened was that the plug in was trying to encode strings that were already encoded, and causing a UnicodeEncodeError.

The fix is simple:

patch.txt

Basically: if there's an encoderror in those lines, it's because it's trying to encode before decoding.

danielfrg commented 8 years ago

Added this patch on https://github.com/danielfrg/pelican-ipynb/commit/251b4b9eea0333a60d0a2f152ff86915188784a9