Package: python-docutils
Version: 0.4-1
Severity: normal

With the docutils default to embed stylesheets, if the stylesheet
I provide and pass in to rst2html via the --stylesheet= option is
UTF-8-encoded, docutils dies:

  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 100: 
ordinal not in range(128)

  The specified output encoding (utf-8) cannot
  handle all of the output.
  Try setting "--output-encoding-error-handler" to

  * "xmlcharrefreplace" (for HTML & XML output);
  Traceback (most recent call last):
    File "/usr/bin/rst2html", line 25, in ?
      publish_cmdline(writer_name='html', description=description)
    File "/usr/lib/site-python/docutils/core.py", line 335, in publish_cmdline
      config_section=config_section, enable_exit_status=enable_exit_status)
    File "/usr/lib/site-python/docutils/core.py", line 217, in publish
      self.report_Exception(error)
    File "/usr/lib/site-python/docutils/core.py", line 256, in report_Exception
      self.report_UnicodeError(error)
    File "/usr/lib/site-python/docutils/core.py", line 285, in 
report_UnicodeError
      sys.stderr.write(
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 0: 
ordinal not in range(128)

Passing --link-stylesheet fixes the issue. Setting 
  @charset "utf-8";
in the first line does not help.

I would suggest fixing this by explicitly declaring the content
encoding for embedded stylesheets, unless the parent document is
already utf-8 (which it is in my case).

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.16-2-xen-amd64-k8
Locale: LANG=en_GB, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)

Versions of packages python-docutils depends on:
ii  python                        2.3.5-10   An interactive high-level object-o
ii  python2.4-docutils            0.4-1      Dependency package for python-docu

python-docutils recommends no packages.

-- no debconf information

-- 
Please do not send copies of list mail to me; I read the list!
 
 .''`.     martin f. krafft <[EMAIL PROTECTED]>
: :'  :    proud Debian developer and author: http://debiansystem.info
`. `'`
  `-  Debian - when you have better things to do than fixing a system

Attachment: signature.asc
Description: Digital signature (GPG/PGP)

Reply via email to