Issue #170 resolved

Exception 'ascii' codec can't decode byte 0xe5

Anonymous avatarAnonymous created an issue

When trying to create an html document from the simple text below which has a "syntax" error I get an exception. I would of course like to get the source file name and line number to able to correct it. (not a problem in this small file but in a big one). The source text file is in utf-8 DOS (Windows line endings) format.

file: -------------------------------

Exception test

This is a unicode document. It generates and exception

Write something that is wrong::

Not indented


make.bat html

Running Sphinx v0.6.1 loading pickled environment... not found building [html]: targets for 2 source files that are out of date updating environment: 2 added, 0 changed, 0 removed reading sources... [ 50%] Export

c:\programs\python25\lib\site-packages\sphinx-0.6.1-py2.5.egg\sphinx\environme -> raise SphinxError(str(err)) (Pdb) print err 'ascii' codec can't decode byte 0xe5 in position 18: ordinal not in range(128) (Pdb) (Pdb) print err.start 18 (Pdb) print err.end 19 (Pdb) print err.object C:\...\Sphinx\Bug\source\Export.rst (Pdb) print err.encoding ascii I am using Sphinx 0.6.1.

Comments (4)

  1. Anonymous

    The error was caused by a problem in docutils/

    It can't handle none ascii characters in the path of the source file. The exception is generated in function astext.

    return u'%s:%s: (%s/%s) %s' % (self['source'], line, self['type'], self['level'], Element.astext(self)

    In my case self['source'] couldn't be decoded with the ascii codec because it had one Swedish character in it.

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.