reStructuredText fails to import docutils.parser.rst

Bug #539181 reported by Florian Friesdorf on 2010-03-15
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zope 2
Invalid
Undecided
Unassigned

Bug Description

- reStructuredText imports docutils.parser.rst
- docutils.parser.rst needs roman
- roman is an optional dependency of docutils which is currently not pulled in

I could not make sense from docutils' setup.py - When installing it into a virtualenv with easy_install from distribute, it does not install roman. When using pip there remains a roman.py in site-packages, however, no egg-info and pip does not tell anything about installing roman as a dependecy - it seems like a bug, that roman is put into site-packages by pip.

I think reStructuredText should require roman or require docutils in a way, that roman is pulled in.

ipdb session:

> /home/cfl/.cache/buildout/eggs/Zope2-2.12.3-py2.6-linux-x86_64.egg/reStructuredText/__init__.py(34)<module>()
     33 # parameter to False.

---> 34 import docutils.parsers.rst
     35 for title, options, conf in docutils.parsers.rst.Parser.settings_spec[2]:

ipdb> l
     29 """ % {'version' : docutils.__version__, 'path' : docutils.__path__[0] }
     30
     31 # Disable inclusion of files for security reasons. We do this by

     32 # changing the default value of the ``file_insertion_enabled``

     33 # parameter to False.
---> 34 import docutils.parsers.rst
     35 for title, options, conf in docutils.parsers.rst.Parser.settings_spec[2]:
     36 if options == ['--file-insertion-enabled']:
     37 conf['default'] = 0
     38 break
     39

ipdb> n
> /home/cfl/.cache/buildout/eggs/docutils-0.6-py2.6.egg/docutils/parsers/rst/__init__.py(76)<module>()
     75 import ipdb;ipdb.set_trace()
---> 76 from docutils.parsers.rst import states
     77 from docutils import frontend, nodes

ipdb> n
ImportError: 'No module named roman'
> /home/cfl/.cache/buildout/eggs/docutils-0.6-py2.6.egg/docutils/parsers/rst/__init__.py(76)<module>()
     75 import ipdb;ipdb.set_trace()
---> 76 from docutils.parsers.rst import states
     77 from docutils import frontend, nodes

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Florian Friesdorf wrote:
> Public bug reported:
>
> - reStructuredText imports docutils.parser.rst
> - docutils.parser.rst needs roman
> - roman is an optional dependency of docutils which is currently not pulled in
>
> I could not make sense from docutils' setup.py - When installing it into
> a virtualenv with easy_install from distribute, it does not install
> roman. When using pip there remains a roman.py in site-packages,
> however, no egg-info and pip does not tell anything about installing
> roman as a dependecy - it seems like a bug, that roman is put into site-
> packages by pip.

 status invalid

The 'roman' module is shipped inside the 'docutils' 0.6 source
distribution in the 'extras' subdirectory. docutils' setup.py carefully
installs it into the docutils egg if it is not already available on the
PYTHONPATH at install time.

Zope2 has tests which verify the importability of docutils.parser.rst.

Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 <email address hidden>
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkuekZIACgkQ+gerLs4ltQ5DcACePvfp473jnKro0MH8lSYJjcV7
fVUAoMs1pJMPOzsA66LeNrP3uYn+FrMp
=Smlj
-----END PGP SIGNATURE-----

Changed in zope2:
status: New → Invalid

It is not inside the egg, in case of:
- being pulled in by buildout as dependency of Zope2
- being installed by easy_install
- being installed by pip (in this case it is installed directly into site-packages as roman.py)

What do you suggest needs to be fixed?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Florian Friesdorf wrote:
> It is not inside the egg, in case of:
> - being pulled in by buildout as dependency of Zope2
> - being installed by easy_install
> - being installed by pip (in this case it is installed directly into site-packages as roman.py)
>
> What do you suggest needs to be fixed?

I can't reproduce your problem:

 $ /path/to/virtualenv-2.6 --no-site-packages /tmp/foo
 $ /tmp/foo/bin/easy_install docutils
 $ /tmp/foo/bin/python
 ...
 >>> import roman
 >>> roman.__file__
 '/tmp/foo/lib/python2.6/site-packages/docutils-0.6-py2.6.egg/roman.pyc'

Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 <email address hidden>
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkufw6kACgkQ+gerLs4ltQ7DIQCgrmoSgBcgcaE00+2k0vGDmD5g
oqcAn3Cu0bV+O1fITYgQKd2onpf7moeG
=Q6Gs
-----END PGP SIGNATURE-----

Thank you very much and sorry for bothering, an egg without roman made it into my egg cache. I consider an egg that is different depending on its install-time environment a bug - but certainly not a bug of Zope2.

Zope2 should require roman as long as docutils is broken, otherwise there is the possibility that an egg without roman enters the egg cache.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.