#8752 closed defect (worksforme)
RestructuredText rendering broken with docutils 0.6
Reported by: | Owned by: | Remy Blank | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | rendering | Version: | 0.11-stable |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
We have a .txt file in our repository with a svn:mime-type set to text/x-rst. Using docutils 0.5 it renders properly in the Trac browser but with the latest docutils 0.6 it renders as plain text.
System Information
Trac: | 0.11.6stable-r8667 |
---|---|
Python: | 2.6.3 (r263:75183, Oct 3 2009, 18:07:35) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] |
setuptools: | 0.6c9 |
SQLite: | 3.6.13 |
pysqlite: | 2.5.5 |
Genshi: | 0.5.1 |
mod_wsgi: | 2.6 |
Pygments: | 1.1.1 |
Subversion: | 1.5.6 (r36142) |
RPC: | 1.0.6 |
Attachments (2)
Change History (13)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Only when I enable DEBUG logging:
2009-10-19 01:02:18,172 Trac[api] WARNING: HTML preview using <trac.mimeview.rst.ReStructuredTextRenderer object at 0x2aaab8a93dd0> failed (Docutils not found) Traceback (most recent call last): File "/usr/local/src/trac-0.11stable/trac/mimeview/api.py", line 725, in render rendered_content, filename, url) File "/usr/local/src/trac-0.11stable/trac/mimeview/rst.py", line 60, in render raise TracError(_('Docutils not found')) TracError: Docutils not found
But obviously using 0.5 there's no problem. I installed both using easy_install-2.6 docutils==0.5
and easy_install-2.6 docutils==0.6
.
follow-up: 9 comment:3 by , 15 years ago
Mmh, I cannot reproduce the issue here (Gentoo). I have 0.6 installed in site-packages
, and rst rendering works. Maybe there's something special when installing with easy_install
.
Could you please try the following in an interactive Python prompt, with 0.6 installed:
from docutils import nodes from docutils.core import publish_parts from docutils.parsers import rst from docutils import __version__
Do you get any exceptions for these?
comment:4 by , 15 years ago
Even when installing Docutils 0.6 into an empty virtualenv that doesn't use the global site-packages
, the imports work, so it's probably not an issue with easy_install
.
comment:6 by , 15 years ago
Milestone: | 0.11.6 |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
No reply, closing as an InstallationIssue. Feel free to reopen with more information to reproduce the issue.
follow-up: 11 comment:7 by , 15 years ago
Keywords: | needinfo removed |
---|---|
Resolution: | worksforme |
Status: | closed → reopened |
So I wrote the attached wsgi script that prints python/distutils/trac info. With docutils 0.6 installed it prints:
Python 2.6.4 (r264:75706, Nov 9 2009, 18:11:10) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] Docutils: 0.6 <module 'docutils' from '/usr/local/lib/python2.6/site-packages/docutils-0.6-py2.6.egg/docutils/__init__.pyc'> Trac: 0.11.6
With docutils 0.5:
Python 2.6.4 (r264:75706, Nov 9 2009, 18:11:10) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] Docutils: 0.5 <module 'docutils' from '/usr/local/lib/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/__init__.pyc'> Trac: 0.11.6
that shows mod_wsgi knows it's using the correct version. cboos suggested to enable the component (which I didn't have to do with 0.5) in trac.ini:
[components] trac.mimeview.rst = enabled
but no luck. I'm also attaching the debug log. So I'll keep using 0.5 for now.
comment:8 by , 15 years ago
Latest sys info:
System Information
Trac: | 0.11.6 |
---|---|
Python: | 2.6.4 (r264:75706, Nov 9 2009, 18:11:10) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] |
setuptools: | 0.6c11 |
SQLite: | 3.6.13 |
pysqlite: | 2.5.5 |
Genshi: | 0.5.1 |
mod_wsgi: | 3.1 (WSGIProcessGroup WSGIApplicationGroup %{GLOBAL}) |
Pygments: | 1.1.1 |
Subversion: | 1.5.6 (r36142) |
RPC: | 1.0.6 |
comment:9 by , 15 years ago
Milestone: | → 0.11.7 |
---|---|
Resolution: | → worksforme |
Status: | reopened → closed |
Replying to rblank:
Mmh, I cannot reproduce the issue here (Gentoo). I have 0.6 installed in
site-packages
, and rst rendering works. Maybe there's something special when installing witheasy_install
.Could you please try the following in an interactive Python prompt, with 0.6 installed:
from docutils import nodes from docutils.core import publish_parts from docutils.parsers import rst from docutils import __version__Do you get any exceptions for these?
Yep, you're right:
Python 2.6.4 (r264:75706, Nov 9 2009, 18:11:10) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from docutils import __version__ >>> __version__ '0.6' >>> from docutils import nodes >>> from docutils.core import publish_parts >>> from docutils.parsers import rst Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.6/site-packages/docutils-0.6-py2.6.egg/docutils/parsers/rst/__init__.py", line 75, in <module> from docutils.parsers.rst import states File "/usr/local/lib/python2.6/site-packages/docutils-0.6-py2.6.egg/docutils/parsers/rst/states.py", line 108, in <module> import roman ImportError: No module named roman >>> thijs@saturn:~$ sudo rm -rf /usr/local/lib/python2.6/site-packages/docutils-* thijs@saturn:~$ sudo easy_install-2.6 docutils==0.6 Searching for docutils==0.6 Reading http://pypi.python.org/simple/docutils/ Reading http://docutils.sourceforge.net/ Best match: docutils 0.6 Downloading http://prdownloads.sourceforge.net/docutils/docutils-0.6.tar.gz?download Processing docutils-0.6.tar.gz Running docutils-0.6/setup.py -q bdist_egg --dist-dir /tmp/easy_install-qiIkiZ/docutils-0.6/egg-dist-tmp-IwJEzJ zip_safe flag not set; analyzing archive contents... docutils.parsers.rst.directives.misc: module references __file__ docutils.writers.html4css1.__init__: module references __file__ docutils.writers.pep_html.__init__: module references __file__ docutils.writers.s5_html.__init__: module references __file__ docutils.writers.latex2e.__init__: module references __file__ docutils.writers.newlatex2e.__init__: module references __file__ docutils.writers.odf_odt.__init__: module references __file__ Adding docutils 0.6 to easy-install.pth file Installing rst2html.py script to /usr/local/bin Installing rst2s5.py script to /usr/local/bin Installing rst2latex.py script to /usr/local/bin Installing rst2newlatex.py script to /usr/local/bin Installing rst2man.py script to /usr/local/bin Installing rst2xml.py script to /usr/local/bin Installing rst2pseudoxml.py script to /usr/local/bin Installing rstpep2html.py script to /usr/local/bin Installing rst2odt.py script to /usr/local/bin Installing rst2odt_prepstyles.py script to /usr/local/bin Installed /usr/local/lib/python2.6/site-packages/docutils-0.6-py2.6.egg Processing dependencies for docutils==0.6 Finished processing dependencies for docutils==0.6 thijs@saturn:~$ python Python 2.6.4 (r264:75706, Nov 9 2009, 18:11:10) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from docutils.parsers import rst >>>
Glad it's fixed again ;) Thanks!
comment:10 by , 15 years ago
Milestone: | 0.11.7 |
---|
Thanks for the feedback. We haven't done anything, though. That roman
module seems to be known for not being installed in some obscure situations:
comment:11 by , 15 years ago
Replying to Thijs Triemstra <info@…>:
cboos suggested to enable the component
more precisely, to verify that the component wasn't disabled, as trac.* components are enabled by default.
Anything special in your log (errors, tracebacks)?