posativ / acrylamid

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

critical ascii error in acrylamid info #144

Closed greatghoul closed 11 years ago

greatghoul commented 11 years ago

My post contains chinese chars, and I works on windows xp (32bit).

After i execute the command acrylamid info, the following error was given.

E:\Blog>acrylamid info
   critical  content/2013\03\compile-vim-with-xterm-clipboard-support.md: ascii
posativ commented 11 years ago

The error does not appear during compilation? Can you please try the current master easy_install https://github.com/posativ/acrylamid/archive/master.zip? It should report a full stack trace and not just a single line ...

greatghoul commented 11 years ago

Current master not works.

E:\Blog>acrylamid info
      error  uncaught exception
Traceback (most recent call last):
  File "D:\Python27\lib\site-packages\acrylamid-0.8.dev0-py2.7.egg\acrylamid\__i
nit__.py", line 209, in Acryl
    tasks.collected[options.parser](conf, env, options)
  File "D:\Python27\lib\site-packages\acrylamid-0.8.dev0-py2.7.egg\acrylamid\tas
ks\info.py", line 157, in run
    do_summary(conf, env, options)
  File "D:\Python27\lib\site-packages\acrylamid-0.8.dev0-py2.7.egg\acrylamid\tas
ks\info.py", line 75, in do_summary
    entrylist, pages, translations, drafts = readers.load(conf)
  File "D:\Python27\lib\site-packages\acrylamid-0.8.dev0-py2.7.egg\acrylamid\rea
ders.py", line 73, in load
    raise AcrylamidException('%s: %s' % (path, e.args[0]))
AcrylamidException: content/2013\03\compile-vim-with-xterm-clipboard-support.md:
 ascii

Same error for command acrylamid compile

posativ commented 11 years ago

It's a quite untransparent error, but I think it raises because your system's default locale prefers ASCII. Does LANG = 'zh_CN' solve your issue?

greatghoul commented 11 years ago

LANG = 'zn_CN' does not work.

posativ commented 11 years ago

I admit that the current way of re-raising a ValueError as AcrylamidException sucks (I guess that it is actually a UnicodeDecodeError, which subclasses from ValueError), but on the other hand I will not develop an OS-specific fix for such an archaic system like Windows XP.

If the issue also occurs on newer Windows versions (I doubt that because I have tested non-ascii characters on Windows 7), I'll fix it. But Windows XP?

As last help: you can try to set ENCODING = 'utf-8' in your configuration.

greatghoul commented 11 years ago

It still does not works. Windows XP sucks. I decide to run acrylamid in vagrant.