posativ / acrylamid

(unmaintained) static blog generator in python with incremental rendering ⛺
http://posativ.org/acrylamid/
Other
277 stars 40 forks source link

TypeError when I try to autocompile #239

Closed soulchainer closed 7 years ago

soulchainer commented 9 years ago

Hi. I just installed and configured acrylamid for first time (Python 3.4, Acrylamid 0.7.10). It compiles without a problem, but can't autocompile. It always returns this error:

acrylamid aco
 * Running on http://127.0.0.1:8000/
Traceback (most recent call last):
  File "/home/soulchainer/.virtualenvs/acrylamid/bin/acrylamid", line 9, in <module>
    load_entry_point('acrylamid==0.7.10', 'console_scripts', 'acrylamid')()
  File "/home/soulchainer/.virtualenvs/acrylamid/lib/python3.4/site-packages/acrylamid/__init__.py", line 204, in Acryl
    commands.autocompile(ws, conf, env)
  File "/home/soulchainer/.virtualenvs/acrylamid/lib/python3.4/site-packages/acrylamid/commands.py", line 261, in autocompile
    conf['content_dir'], conf['content_ignore']) if istext(e)),
  File "/home/soulchainer/.virtualenvs/acrylamid/lib/python3.4/site-packages/acrylamid/commands.py", line 261, in <genexpr>
    conf['content_dir'], conf['content_ignore']) if istext(e)),
  File "/home/soulchainer/.virtualenvs/acrylamid/lib/python3.4/site-packages/acrylamid/utils.py", line 242, in istext
    return magic.from_file(path, mime=True).startswith('text/')
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

Can you help me? Just in case, here is my conf.py:

# -*- encoding: utf-8 -*-
# This is your configuration file.  Please write valid python!
# See http://posativ.org/acrylamid/conf.py.html

SITENAME = 'Soulbits'
WWW_ROOT = 'https://soulchainer.github.io/'

AUTHOR = 'Soulchainer'
EMAIL = 'myemail@mydomain.com'

FILTERS = ['restructuredtext', 'hyphenate', 'h1']
VIEWS = {
    '/': {
        'filters': 'intro+3',
        'view': 'index',
        'pagination': '/page/:num/',
        'items_per_page': 6,
    },
    '/:year/:month/:day/:slug/': {'views': ['entry', 'draft']},
    '/tags/:name/': {
        'filters': 'summarize+3',
        'view': 'tag',
        'pagination': '/tag/:name/:num/',
    },
    '/atom/': {
        'filters': ['h2', 'nohyphenate'],
        'view': 'atom',
    },
    '/rss/': {
        'filters': ['h2', 'nohyphenate'],
        'view': 'rss',
    },
    '/archives/': {
        'view': 'archive',
        'template': 'articles.html',
    },
    '/sitemap.xml': {'view': 'sitemap'},
    '/:slug/': {'view': 'page'},
}

OUTPUT_DIR = 'output/'
CONTENT_DIR = 'content/'
CONTENT_EXTENSION = '.rst'
THEME = 'theme'
STATIC = 'static'
STATIC_FILTER = ['SCSS']
ENGINE = 'acrylamid.templates.jinja2.Environment'
DATE_FORMAT = '%a %d %m %Y, %H:%M'
DISQUS_SHORTNAME = 'myshortname'
DEFAULT_ORPHANS = 4
TAG_CLOUD_STEPS = 4
TAG_CLOUD_MAX_ITEMS = 300
TAG_CLOUD_SHUFFLE = True

And the packages I have installed in virtualenv:

acrylamid (0.7.10)
docutils (0.12)
Jinja2 (2.6)
Markdown (2.6.1)
MarkupSafe (0.23)
pip (6.1.1)
Pygments (2.0.2)
python-magic (0.4.6)
PyYAML (3.11)
setuptools (15.1)
smartypants (1.8.6)
Unidecode (0.4.17)