On 2011-08-31, Ernesto Posse wrote:
> On Wed, Aug 31, 2011 at 3:38 PM, Aivar <[email protected]> wrote:
>> Hi!

>> In some cases, when I make syntax mistake in reST source and when
>> there is a non-ascii character around, I get stacktrace instead of
>> helpful message telling me where is the mistake. It's quite hard to
>> track down such mistakes.

>> One example is when I forget empty line after directive, for example:

>> .. sourcecode:: python
>>    for i in range(a,b):
>>        # käsud


>> Another example: too short section underline:

>>      Lisanäited
>>      ------

>> I'm not sure if this is problem in Sphinx or in docutils, can't tell
>> from the stacktrace:

...

> In the example you are giving the message at the and of the trace is
> telling you exactly what the problem is: you included some non-ASCII
> character in a plain ASCII file. But this is not a Sphinx-specific
> issue. This is a general Python issue. This is not a bug in Sphinx (or
> Python): if you give as input a file with non-ASCII characters the
> correct behaviour is to raise an exception, as is the case here.

While the first example shows Python source code, both examples are from a
reStructuredText input file. Docutils and Sphinx both default to UTF-8 input
encoding (and allow to specify a different input encoding in the settings).

However, both Docutils and Sphinx also have (or had) problems with error
reporting due to the string/unicode conversions. Most of Docutils'
problems are solved in release 0.8. Some remaining ones as well as a
Sphinx incompatibility with LaTeX output are solved in the development
version. You might try with a Docutils  SVN checkout or daily snapshot.

Günter

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.

Reply via email to