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

blogofile build fails with anything but bare #99

Open
kasbah opened this issue May 10, 2011 · 5 comments
Open

blogofile build fails with anything but bare #99

kasbah opened this issue May 10, 2011 · 5 comments
Labels

Comments

@kasbah
Copy link

kasbah commented May 10, 2011

I installed Blogofile through easy_install on my Debian 6.0 VPS which has Python 2.6.6 and "blogofile build" fails on anything but the "bare" init.

On a "simple_blog" init it fails:

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-0.7.1-py2.6.egg/blogofile/main.py", line 135, in main
    args.func(args)
  File "/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/blogofile/main.py", line 201, in do_build
    writer.write_site()
  File "/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/blogofile/writer.py", line 52, in write_site
    self.__run_controllers()
  File "/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/blogofile/writer.py", line 136, in __run_controllers
    controller.run_all()
  File "/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/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)

On a "blogfile.com" init it fails:

    load_entry_point('Blogofile==0.7.1', 'console_scripts', 'blogofile')()
  File "/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/blogofile/main.py", line 135, in main
    args.func(args)
  File "/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/blogofile/main.py", line 195, in do_build
    config_init(args)
  File "/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/blogofile/main.py", line 175, in config_init
    config.init("_config.py")
  File "/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/blogofile/config.py", line 92, in init
    __load_config(config_file_path)
  File "/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/blogofile/config.py", line 69, in __load_config
    execfile(path)
  File "_config.py", line 34, in <module>
    blog = plugins.blog
NameError: name 'plugins' is not defined

@EnigmaCurry
Copy link
Owner

Regarding the first error (init simple_blog):

This is becoming a bit of a theme. On some systems, python won't read a file with a filename that has unicode characters in it. Renaming "_posts/003 - post 3 - unicode test - 日本語 test.markdown" to something else without unicode characters has fixed this. I have never been able to reproduce this error myself though (Ubuntu 10.04 python-2.6.5)

Regarding the second error (init blogofile.com):

Totally my fault, I didn't tag the blogofile.com sources in the 0.7.1 release, so it's just pulling the latest blogofile.com sources, which I've converted to 0.8. You can check out the correct version with:

git clone http://github.com/EnigmaCurry/blogofile.com.git
git checkout 0.7.1

Even though I'm trying hard to release 0.8, I'll create a 0.7.2 release tonight to fix these issues. Thanks for your patience!

@kasbah
Copy link
Author

kasbah commented May 11, 2011

OK, In the first case I had to delete all unicode characters in the post 3
markdown file after renaming it or it would fail:

  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-0.7.1-py2.6.egg/blogofile/main.py",
line 135, in main
    args.func(args)
  File
"/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/blogofile/main.py",
line 201, in do_build
    writer.write_site()
  File
"/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/blogofile/writer.py",
line 52, in write_site
    self.**run_controllers()
  File
"/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/blogofile/writer.py",
line 136, in __run_controllers
    controller.run_all()
  File
"/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/blogofile/controller.py",
line 203, in run_all
    controller.run()
  File "_controllers/blog/__init**.py", line 38, in run
    permapage.run()
  File "_controllers/blog/permapage.py", line 9, in run
    write_permapages()
  File "_controllers/blog/permapage.py", line 38, in write_permapages
    "permapage.mako", bf.util.path_join(path, "index.html"), env)
  File
"/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/blogofile/writer.py",
line 168, in materialize_template
    util.mkdir(os.path.split(path)[0])
  File
"/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/blogofile/util.py",
line 46, in mkdir
    if os.path.isdir(newdir):
  File "/usr/lib/python2.6/genericpath.py", line 41, in isdir
    st = os.stat(s)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 62-67:
ordinal not in range(128)

In the second case in addition to checking out the 0.7.1 tag I had to
install pyquery which also pulled in the following dependencies:

python-lxml i386 2.2.8-2
python-webob all 0.9.8-1
python-pyquery all 0.6.1-1

or it would fail:

  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-0.7.1-py2.6.egg/blogofile/main.py",
line 135, in main
    args.func(args)
  File
"/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/blogofile/main.py",
line 195, in do_build
    config_init(args)
  File
"/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/blogofile/main.py",
line 175, in config_init
    config.init("_config.py")
  File
"/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/blogofile/config.py",
line 92, in init
    __load_config(config_file_path)
  File
"/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/blogofile/config.py",
line 66, in __load_config
    filter.preload_filters()
  File
"/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/blogofile/filter.py",
line 59, in preload_filters
    load_filter(fn[:-3])
  File
"/usr/local/lib/python2.6/dist-packages/Blogofile-0.7.1-py2.6.egg/blogofile/filter.py",
line 95, in load_filter
    mod = __loaded_filters[name] = __import__(name)
  File "_filters/paragraph_permalinks.py", line 8, in <module>
    from pyquery import PyQuery as pq
ImportError: No module named pyquery

@kasbah kasbah closed this as completed May 11, 2011
@kasbah kasbah reopened this May 11, 2011
@EnigmaCurry
Copy link
Owner

Mark from the mailing list finally tracked down the unicode issue down to his shell environment not having a $LANG set.

On my machine I have LANG=en_US.utf8 -- unsetting that produces the UnicodeError.

@kasbah
Copy link
Author

kasbah commented May 20, 2011

Yeah so this was my fault for not configuring my system properly. For future
reference to fix this on a Debian server:

Reconfigure locales:

#dpkg-reconfigure locales

Select the locales your users are likely to use. Leave the default locale to
none as it may cause problems with users who want a different locale on
their ssh session.
On your server you need to make sure that this is in your
/etc/ssh/sshd_config:

AcceptEnv LANG LC_*

In your local ssh config (/etc/ssh/ssh_config or ~/.ssh/config) you need to
set

 SendEnv LANG LC_*

That should sort out your locale correctly for SSH sessions.

On 20 May 2011 14:08, EnigmaCurry <
[email protected]>wrote:

Mark from the mailing list finally tracked down the unicode issue down to
his shell environment not having a $LANG set.

On my machine I have LANG=en_US.utf8 -- unsetting that produces the
UnicodeError.

Reply to this email directly or view it on GitHub:
#99 (comment)

@exarkun
Copy link

exarkun commented Jan 8, 2012

The plugin issue does not appear to be resolved? Or maybe the fix is just unreleased? Using 0.7.1, the config still tries to use the undefined name "plugin", making the blogofile.com template unusable.

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

No branches or pull requests

3 participants