Follow on from incomplete fix in [14477], and [14631] which removed compatibility for Sphinx < 1.0 Backport of [14639] from trunk, and [14477] which was never applied to 1.2.X branch but should have been. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14640 bcc190cf-cafb-0310-a4f2-bffc1f526a37