Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ablog build" fails in a fresh repository, encoding issues with conf.py #86

Open
tiwo opened this issue May 21, 2017 · 3 comments · May be fixed by #87
Open

"ablog build" fails in a fresh repository, encoding issues with conf.py #86

tiwo opened this issue May 21, 2017 · 3 comments · May be fixed by #87

Comments

@tiwo
Copy link

tiwo commented May 21, 2017

On Windows, ablog build somwhere assumes conf.py's encoding as "cp1252", triggering UnicodeDecodeError when using non-ASCII character in the blog title (äöüß).

@tiwo
Copy link
Author

tiwo commented May 21, 2017

While writing up how to reproduce this issue, I realize this happens even when I only use ASCII characters; fancy Unicode quotes in ablog's conf.py template are the culprits (“title”) .

I'm quite sure that the fancy quotes should be replaced by ASCII quotes, and I'll send a (trivial) partial fix later today or tomorrow. I'll still have to see if accents and umlauts in e.g. the blog title work.


Here's how to reproduce this issue: I use Windows, MINGW64 bash, Python 3.5.2. In an empty directory:

$ virtualenv ENV
[...]
$ source ENV/Scripts/activate
(ENV) $ pip install ablog
[...]
(ENV) $ pip show ablog
Name: ablog
Version: 0.8.4
[...]

Now, $ ablog start fails for me because of issue #78, "cannot import name make_admonition"; I apply lsaffre@046e5db to ENV/Lib/site-packages/ablog/post.py to get that out of the way. Then:

(ENV) $ ablog start
Welcome to the ABlog 0.8.4 quick start utility.

I press Enter, ANYTITLE Enter, ANYNAME Enter, Enter.

[...]
Creating file .\conf.py.
Creating file .\index.rst.
Creating file .\about.rst.
Creating file .\first-post.rst.
Finished: An initial directory structure has been created.

(ENV) $ ablog build
Traceback (most recent call last):
  File "c:\program files\python35\Lib\runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\program files\python35\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\blgus\AppData\Local\Temp\bug\ENV\Scripts\ablog.exe\__main__.py", line 9, in <module>
  File "c:\users\blgus\appdata\local\temp\bug\env\lib\site-packages\ablog\commands.py", line 404, in ablog_main
    namespace.func(**namespace.__dict__)
  File "c:\users\blgus\appdata\local\temp\bug\env\lib\site-packages\ablog\commands.py", line 119, in ablog_build
    confdir = find_confdir()
  File "c:\users\blgus\appdata\local\temp\bug\env\lib\site-packages\ablog\commands.py", line 22, in find_confdir
    if isfile(conf) and 'ablog' in open(conf).read():
  File "c:\users\blgus\appdata\local\temp\bug\env\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 585: character maps to <undefined>

tiwo added a commit to tiwo/ablog that referenced this issue May 21, 2017
cf. issue abakan-zz#86.

(also correct a typo on the same line)
@tiwo tiwo linked a pull request May 21, 2017 that will close this issue
tiwo added a commit to tiwo/ablog that referenced this issue May 25, 2017
* tiwo/abakan-zz#86:
  don't use fancy quotes in the conf.py template
@benjaminweb
Copy link

Confirmed for me. I currently only resist to adopt ablog for stability concerns.

@nabobalis
Copy link

A new version of Ablog (v0.9.0) is out at this repo.

This issue should be fixed now but we made it explicitly support Sphinx>=1.6.

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

Successfully merging a pull request may close this issue.

3 participants