Skip to content
This repository has been archived by the owner on Apr 16, 2019. It is now read-only.

macos blogofile.template:Error rendering template: permapage.mako #148

Open
ghost opened this issue Jul 28, 2013 · 6 comments
Open

macos blogofile.template:Error rendering template: permapage.mako #148

ghost opened this issue Jul 28, 2013 · 6 comments

Comments

@ghost
Copy link

ghost commented Jul 28, 2013

smart@smarttekiMacBook-Pro ~/Sites
% blogofile init mysite blog !219
blog plugin site_src files written to mysite

smart@smarttekiMacBook-Pro ~/Sites
% blogofile build -s mysite !220
ERROR:blogofile.template:Error rendering template: permapage.mako

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Blogofile-0.8b1-py2.7.egg/blogofile/template.py", line 157, in render
rendered = self.mako_template.render(*_self)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Mako-0.7.2-py2.7.egg/mako/template.py", line 412, in render
return runtime.render(self, self.callable, args, data)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Mako-0.7.2-py2.7.egg/mako/runtime.py", line 766, in _render
*_kwargs_for_callable(callable, data))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Mako-0.7.2-py2.7.egg/mako/runtime.py", line 798, in _render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Mako-0.7.2-py2.7.egg/mako/runtime.py", line 824, in exec_template
callable
(context, _args, *_kwargs)
File "_templates/base.mako", line 2, in render_body
${next.body()}
File "_templates/site.mako", line 20, in render_body
${next.body()}
File "_templates/blog/permapage.mako", line 2, in render_body
<%include file="post.mako" args="post=post" />
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Mako-0.7.2-py2.7.egg/mako/runtime.py", line 693, in include_file
callable
(ctx, *_kwargs_for_include(callable, context._data, *_kwargs))
File "_templates/blog/post.mako", line 18, in render_body

${post.date.strftime("%B %d, %Y at %I:%M %p")} | categories:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 0: ordinal not in range(128)

ERROR:blogofile:Fatal build error occured, calling bf.config.build_exception()
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/blogofile", line 9, in
load_entry_point('Blogofile==0.8b1', 'console_scripts', 'blogofile')()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Blogofile-0.8b1-py2.7.egg/blogofile/main.py", line 58, in main
args.func(args)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Blogofile-0.8b1-py2.7.egg/blogofile/main.py", line 388, in do_build
writer.write_site()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Blogofile-0.8b1-py2.7.egg/blogofile/writer.py", line 49, in write_site
self.run_controllers()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Blogofile-0.8b1-py2.7.egg/blogofile/writer.py", line 162, in __run_controllers
controller.run_all(namespaces)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Blogofile-0.8b1-py2.7.egg/blogofile/controller.py", line 229, in run_all
c.mod.run()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/blogofile_blog-0.8b1-py2.7.egg/blogofile_blog/site_src/_controllers/blog/__init
.py", line 80, in run
permapage.run()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/blogofile_blog-0.8b1-py2.7.egg/blogofile_blog/site_src/_controllers/blog/permapage.py", line 12, in run
write_permapages()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/blogofile_blog-0.8b1-py2.7.egg/blogofile_blog/site_src/_controllers/blog/permapage.py", line 38, in write_permapages
"permapage.mako", bf.util.path_join(path, "index.html"), env)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Blogofile-0.8b1-py2.7.egg/blogofile/plugin.py", line 160, in materialize_template
lookup=self.template_lookup, caller=self.module)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Blogofile-0.8b1-py2.7.egg/blogofile/template.py", line 388, in materialize_template
template.render(location)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Blogofile-0.8b1-py2.7.egg/blogofile/template.py", line 157, in render
rendered = self.mako_template.render(**self)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Mako-0.7.2-py2.7.egg/mako/template.py", line 412, in render
return runtime.render(self, self.callable, args, data)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Mako-0.7.2-py2.7.egg/mako/runtime.py", line 766, in _render
**kwargs_for_callable(callable, data))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Mako-0.7.2-py2.7.egg/mako/runtime.py", line 798, in _render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Mako-0.7.2-py2.7.egg/mako/runtime.py", line 824, in exec_template
callable
(context, _args, *_kwargs)
File "base_mako", line 23, in render_body
File "site_mako", line 41, in render_body
File "permapage_mako", line 35, in render_body
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Mako-0.7.2-py2.7.egg/mako/runtime.py", line 693, in include_file
callable
(ctx, *_kwargs_for_include(callable, context._data, *_kwargs))
File "post_mako", line 49, in render_body
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 0: ordinal not in range(128)

@crayxt
Copy link

crayxt commented Apr 6, 2014

Before running blogofile build, set the language with
export LANG=en_US.UTF-8 (or export LANG=C)

@iuriguilherme
Copy link

@crayxt I have the same issue and the LANG envvar is properly set (in my case it's pt_BR.UTF-8).

@iuriguilherme
Copy link

Same issue of #136, #138, #141, #147 and #152

@crayxt
Copy link

crayxt commented Aug 4, 2014

@iuriguilherme I meant always set language to en_US.UTF-8 or C, sorry for being unclear

@iuriguilherme
Copy link

@crayxt I have got your point already.
Here is what I have:

$ export LANG=C; blogofile build
Traceback (most recent call last):
  File "/usr/lib/python2.6/logging/__init__.py", line 799, in emit
    stream.write(fs % msg.encode("UTF-8"))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 78: ordinal not in range(128)
Traceback (most recent call last):
  File "/usr/local/bin/blogofile", line 9, in <module>
    load_entry_point('Blogofile==0.7.1', 'console_scripts', 'blogofile')()
  File "/usr/local/lib/python2.6/dist-packages/blogofile/main.py", line 135, in main
    args.func(args)
  File "/usr/local/lib/python2.6/dist-packages/blogofile/main.py", line 201, in do_build
    writer.write_site()
  File "/usr/local/lib/python2.6/dist-packages/blogofile/writer.py", line 52, in write_site
    self.__run_controllers()
  File "/usr/local/lib/python2.6/dist-packages/blogofile/writer.py", line 136, in __run_controllers
    controller.run_all()
  File "/usr/local/lib/python2.6/dist-packages/blogofile/controller.py", line 203, in run_all
    controller.run()
  File "_controllers/blog/__init__.py", line 25, in run
    blog.posts = post.parse_posts("_posts")
  File "_controllers/blog/post.py", line 328, in parse_posts
    src = open(post_path, "r").read().decode(
UnicodeEncodeError: 'ascii' codec can't encode characters in position 37-39: ordinal not in range(128)

Same result with

$ export LANG=C && blogofile build

@crayxt
Copy link

crayxt commented Aug 12, 2014

@iuriguilherme sorry for confusion. I have migrated to other static blog generator since then, cannot help.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants