getnikola / plugins

Extra plugins for Nikola
https://plugins.getnikola.com/
MIT License
59 stars 95 forks source link

[asciidoc] TypeError: a bytes-like object is required, not 'str' #296

Closed gour closed 5 years ago

gour commented 5 years ago

Hello,

attempt to use Asciidoc plugin with emojis (Nikola v8.0.1) results in:

[...]
.  render_posts:cache/blog/emoji-test.html
[2019-01-13T11:59:26Z] WARNING: scan_posts: Repeated emoji turkey
TaskError - taskid:render_posts:cache/blog/emoji-test.html
PythonAction Error
Traceback (most recent call last):
  File "/home/gour/.virtualenvs/nikola/lib/python3.7/site-packages/doit/action.py", line 424, in execute
    returned_value = self.py_callable(*self.args, **kwargs)
  File "/home/gour/.virtualenvs/nikola/lib/python3.7/site-packages/nikola/post.py", line 652, in compile
    lang)
  File "/home/gour/prj/vf/nikola/test/plugins/asciidoc/asciidoc.py", line 75, in compile
    output, error_level, deps, shortcode_deps = self.compile_string(data, source, is_two_file, post, lang)
  File "/home/gour/prj/vf/nikola/test/plugins/asciidoc/asciidoc.py", line 65, in compile_string
    output, shortcode_deps = self.site.apply_shortcodes_uuid(output, shortcodes, filename=source_path, extra_context={'post': post})
  File "/home/gour/.virtualenvs/nikola/lib/python3.7/site-packages/nikola/nikola.py", line 1629, in apply_shortcodes_uuid
    data = data.replace(k, replacement)
TypeError: a bytes-like object is required, not 'str'

########################################
render_posts:cache/blog/emoji-test.html <stdout>:

Here is the simple post:

///
.. title: Emoji test
.. slug: emoji-test
.. date: 2019-01-13 12:56:12 UTC+01:00
.. tags: tag1 
.. category: cat1 
.. link: 
.. description: 
.. type: text
///

Write your post here. {{% emoji smiling_face_with_open_mouth %}}

Any hint? (I've tried with YAML meta and it is the same.)

Considering that Asciidoc has begun process of creating specification it becomes more attractive markup option than to fiddle with different markdown 'standards'...

ralsina commented 5 years ago

Sadly I can't take a look at this currently because on OSX asciidoc is broken via brew:

Error: Calling needs :cxx11 is disabled! There is no replacement.
Please report this to the caskformula/caskformula tap:
  /usr/local/Homebrew/Library/Taps/caskformula/homebrew-caskformula/Formula/inkscape.rb:49

and I plan on spending no time working on fixing that. If I ever have some time on my personal linux computer instrad of my work's osx one I will take a look.