Docs not building with Sphinx 1.2

Bug #1163369 reported by Julie Pichon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Julie Pichon
Grizzly
Fix Released
Undecided
Julie Pichon

Bug Description

Sphinx 1.2b1 came out on the 31st. When running ./run_tests.sh --docs, the following happens:

reading sources... [ 64%] sourcecode/openstack_dashboard/openstack_dashboard.dashboards.project.images_and_snapshots.images.tables
Exception occurred:
  File "/home/jpichon/devel/horizon/.venv/lib/python2.7/site-packages/sphinx/application.py", line 349, in emit
    self.debug2('[app] emitting event: %r%s', event, repr(args)[:100])
TypeError: __repr__ returned non-string (type NoneType)
The full traceback has been saved in /tmp/sphinx-err-xn6noG.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.

Not much more information in the indicated logs besides version numbers:
# Sphinx version: 1.2b1
# Python version: 2.7.3
# Docutils version: 0.9.1 release
# Jinja2 version: 2.6
  File "/home/jpichon/devel/horizon/.venv/lib/python2.7/site-packages/sphinx/ext/autodoc.py", line 1346, in run
    documenter.generate(more_content=self.content)
  File "/home/jpichon/devel/horizon/.venv/lib/python2.7/site-packages/sphinx/ext/autodoc.py", line 755, in generate
    self.document_members(all_members)
  File "/home/jpichon/devel/horizon/.venv/lib/python2.7/site-packages/sphinx/ext/autodoc.py", line 648, in document_members
    for (mname, member, isattr) in self.filter_members(members, want_all):
  File "/home/jpichon/devel/horizon/.venv/lib/python2.7/site-packages/sphinx/ext/autodoc.py", line 616, in filter_members
    not keep, self.options)
  File "/home/jpichon/devel/horizon/.venv/lib/python2.7/site-packages/sphinx/application.py", line 357, in emit_firstresult
    for result in self.emit(event, *args):
  File "/home/jpichon/devel/horizon/.venv/lib/python2.7/site-packages/sphinx/application.py", line 349, in emit
    self.debug2('[app] emitting event: %r%s', event, repr(args)[:100])
TypeError: __repr__ returned non-string (type NoneType)

See also http://logs.openstack.org/25901/1/check/gate-horizon-docs/1566/console.html

Julie Pichon (jpichon)
Changed in horizon:
assignee: nobody → Julie Pichon (jpichon)
Changed in horizon:
status: New → Confirmed
Changed in horizon:
importance: Undecided → High
milestone: none → havana-1
Revision history for this message
Julie Pichon (jpichon) wrote :

The quick and easy solution is to pin Sphinx to 1.1.3, although it would be nice to figure out exactly why Sphinx is failing. It's happening for openstack_dashboard.dashboards.project.images_and_snapshots.images.tables and openstack_dashboard.usage.quotas.

Revision history for this message
Julie Pichon (jpichon) wrote :

The error is thrown because of the Sphinx debug message itself. This is due to a repr() call that can sometimes return None, which apparently contradicts a Python convention.

https://github.com/openstack/horizon/blob/master/horizon/utils/memoized.py#L41

Changed in horizon:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/25946

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/25946
Committed: http://github.com/openstack/horizon/commit/29cb3251afd65fdd0a98b76d58f05458aaab3b47
Submitter: Jenkins
Branch: master

commit 29cb3251afd65fdd0a98b76d58f05458aaab3b47
Author: Julie Pichon <email address hidden>
Date: Tue Apr 2 22:08:33 2013 +0100

    Return an empty string rather than None when calling repr()

    Repr() should return "a string containing a printable representation of
    an object," which is a convention Sphinx 1.2 relies on when building
    the docs.

    Fixes bug 1163369

    Change-Id: Ieefd69c5b4b521500679df7745f60cb3a4d2f77c

Changed in horizon:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/grizzly)

Fix proposed to branch: stable/grizzly
Review: https://review.openstack.org/26202

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/grizzly)

Reviewed: https://review.openstack.org/26202
Committed: http://github.com/openstack/horizon/commit/2a939ceb2aa7cc206fd1c3db768d6cb39c903e18
Submitter: Jenkins
Branch: stable/grizzly

commit 2a939ceb2aa7cc206fd1c3db768d6cb39c903e18
Author: Julie Pichon <email address hidden>
Date: Tue Apr 2 22:08:33 2013 +0100

    Return an empty string rather than None when calling repr()

    Repr() should return "a string containing a printable representation of
    an object," which is a convention Sphinx 1.2 relies on when building
    the docs.

    Fixes bug 1163369

    Change-Id: Ieefd69c5b4b521500679df7745f60cb3a4d2f77c
    (cherry picked from commit 29cb3251afd65fdd0a98b76d58f05458aaab3b47)

Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: havana-1 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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