[Python-modules-commits] r22917 - in packages/sphinx/trunk/debian (3 files)

jwilk at users.alioth.debian.org jwilk at users.alioth.debian.org
Thu Nov 8 12:42:29 UTC 2012


    Date: Thursday, November 8, 2012 @ 12:42:27
  Author: jwilk
Revision: 22917

Fix compatibility with Python 3.3.

Added:
  packages/sphinx/trunk/debian/patches/support_python_3.3.diff
Modified:
  packages/sphinx/trunk/debian/changelog
  packages/sphinx/trunk/debian/patches/series

Modified: packages/sphinx/trunk/debian/changelog
===================================================================
--- packages/sphinx/trunk/debian/changelog	2012-11-08 06:17:14 UTC (rev 22916)
+++ packages/sphinx/trunk/debian/changelog	2012-11-08 12:42:27 UTC (rev 22917)
@@ -15,14 +15,15 @@
     bug report.
   * Sort stopwords in searchtools.js. Thanks to Dmitry Shachnev for the bug
     report.
+  * Fix compatibility with Python 3.3. Thanks to Dmitry Shachnev for the bug
+    report and hunting down the upstream patch.
 
   [ Dmitry Shachnev ]
   * Update Homepage field to point to http://sphinx-doc.org/.
   * Build-depend of python3-all instead of python3.
 
+ -- Jakub Wilk <jwilk at debian.org>  Thu, 08 Nov 2012 13:40:48 +0100
 
- -- Jakub Wilk <jwilk at debian.org>  Thu, 08 Nov 2012 00:31:15 +0100
-
 sphinx (1.1.3+dfsg-4) unstable; urgency=low
 
   * Add DEP-8 tests.

Modified: packages/sphinx/trunk/debian/patches/series
===================================================================
--- packages/sphinx/trunk/debian/patches/series	2012-11-08 06:17:14 UTC (rev 22916)
+++ packages/sphinx/trunk/debian/patches/series	2012-11-08 12:42:27 UTC (rev 22917)
@@ -10,3 +10,4 @@
 fix_shorthandoff.diff
 test_build_html_rb.diff
 sort_stopwords.diff
+support_python_3.3.diff

Added: packages/sphinx/trunk/debian/patches/support_python_3.3.diff
===================================================================
--- packages/sphinx/trunk/debian/patches/support_python_3.3.diff	                        (rev 0)
+++ packages/sphinx/trunk/debian/patches/support_python_3.3.diff	2012-11-08 12:42:27 UTC (rev 22917)
@@ -0,0 +1,63 @@
+Description: fix compatibility with Python 3.3
+Author: Takayuki Shimizukawa <shimizukawa at gmail.com>
+Bug: https://bitbucket.org/birkenfeld/sphinx/issue/1008/test-failures-with-python-33
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1070336
+Last-Update: 2012-11-08
+
+--- a/sphinx/ext/autodoc.py
++++ b/sphinx/ext/autodoc.py
+@@ -1098,7 +1098,7 @@
+     """
+     objtype = 'method'
+     member_order = 50
+-    priority = 0
++    priority = 1  # must be more than FunctionDocumenter
+ 
+     @classmethod
+     def can_document_member(cls, member, membername, isattr, parent):
+--- a/sphinx/ext/intersphinx.py
++++ b/sphinx/ext/intersphinx.py
+@@ -188,7 +188,17 @@
+     if update:
+         env.intersphinx_inventory = {}
+         env.intersphinx_named_inventory = {}
+-        for name, _, invdata in cache.itervalues():
++        # Duplicate values in different inventories will shadow each
++        # other; which one will override which can vary between builds
++        # since they are specified using an unordered dict.  To make
++        # it more consistent, we sort the named inventories and then
++        # add the unnamed inventories last.  This means that the
++        # unnamed inventories will shadow the named ones but the named
++        # ones can still be accessed when the name is specified.
++        cached_vals = list(cache.itervalues())
++        named_vals = sorted(v for v in cached_vals if v[0])
++        unnamed_vals = [v for v in cached_vals if not v[0]]
++        for name, _, invdata in named_vals + unnamed_vals:
+             if name:
+                 env.intersphinx_named_inventory[name] = invdata
+             for type, objects in invdata.iteritems():
+--- a/sphinx/util/__init__.py
++++ b/sphinx/util/__init__.py
+@@ -197,13 +197,18 @@
+         except Exception, err:
+             raise PycodeError('error importing %r' % modname, err)
+     mod = sys.modules[modname]
+-    if hasattr(mod, '__loader__'):
++    filename = getattr(mod, '__file__', None)
++    loader = getattr(mod, '__loader__', None)
++    if loader and getattr(loader, 'get_filename', None):
++        try:
++            filename = loader.get_filename(modname)
++        except Exception, err:
++            raise PycodeError('error getting filename for %r' % filename, err)
++    if filename is None and loader:
+         try:
+-            source = mod.__loader__.get_source(modname)
++            return 'string', loader.get_source(modname)
+         except Exception, err:
+             raise PycodeError('error getting source for %r' % modname, err)
+-        return 'string', source
+-    filename = getattr(mod, '__file__', None)
+     if filename is None:
+         raise PycodeError('no source found for module %r' % modname)
+     filename = path.normpath(path.abspath(filename))




More information about the Python-modules-commits mailing list