typogrify filter seems to be broken

6 views
Skip to first unread message

klingt net

unread,
Apr 16, 2014, 6:06:38 PM4/16/14
to nikola-...@googlegroups.com
Hi,

when i use the typogrify filter the build process ends with this message:

.  render_archive:output/archive.html
########################################
TaskError - taskid:render_archive:output/archive.html
PythonAction Error
Traceback (most recent call last):
  File "/home/andreas/personal/dev/.virtualenvs/klingt.net/lib/python3.4/site-packages/doit/action.py", line 360, in execute
    returned_value = self.py_callable(*self.args, **kwargs)
  File "/home/andreas/personal/dev/.virtualenvs/klingt.net/lib/python3.4/site-packages/nikola/utils.py", line 529, in unlessLink
    action(target)
  File "/home/andreas/personal/dev/.virtualenvs/klingt.net/lib/python3.4/site-packages/nikola/filters.py", line 52, in f_in_file
    data = f(data)
  File "/home/andreas/personal/dev/.virtualenvs/klingt.net/lib/python3.4/site-packages/nikola/filters.py", line 181, in typogrify
    data = typo.amp(data)
  File "/home/andreas/personal/dev/.virtualenvs/klingt.net/lib/python3.4/site-packages/typogrify/filters.py", line 93, in amp
    output = intra_tag_finder.sub(_amp_process, text)
TypeError: can't use a string pattern on a bytes-like object

Without this filter the site builds successfully. Does someone has the same problem?
PS: I'm using nikola 6.4 with a custom theme.

FILTERS = {
  '.html': [filters.typogrify],
  '.jpg': [filters.jpegoptim]
  }

Roberto Alsina

unread,
Apr 16, 2014, 9:02:11 PM4/16/14
to nikola-...@googlegroups.com
This is python3, right?

klingt net

unread,
Apr 17, 2014, 4:01:27 AM4/17/14
to nikola-...@googlegroups.com
Correct, Python 3.4.0

Roberto Alsina

unread,
Apr 17, 2014, 7:56:32 AM4/17/14
to nikola-...@googlegroups.com
On 16/04/14 19:06, klingt net wrote:
On 6.4.0 we were recommending installation of a different version of typogrify, development has moved since, and perhaps that version was not really python3-ready.
Could you check if github master works for you?

klingt net

unread,
Apr 17, 2014, 8:36:06 AM4/17/14
to nikola-...@googlegroups.com
I have installed the  latest version from github but the error message was the same.
I even tried to encode the second of the intra_tag_finder call at line 93 in filters.py, like so:

 output = intra_tag_finder.sub(_amp_process, text.encode('utf-8'))

But text doesn't seem to be of type String, maybe it is already called in nikolas filters.py with the wrong data type.

Roberto Alsina

unread,
Apr 17, 2014, 8:51:45 AM4/17/14
to nikola-...@googlegroups.com
Ok, this is issue #1244 if you want to see what happens.

Chris “Kwpolska” Warrick

unread,
Apr 17, 2014, 8:52:02 AM4/17/14
to Nikola—Discuss
> --
> You received this message because you are subscribed to the Google Groups
> "nikola-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nikola-discus...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Try:

pip uninstall -qy typogrify
pip uninstall -qy typogrify-web
pip install typogrify

does it work now?

Also, the discussion should move here:
https://github.com/getnikola/nikola/issues/1244

--
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
Reply all
Reply to author
Forward
0 new messages