Georg Brandl avatar Georg Brandl committed 4a6d332 Merge

merge with stable

Comments (0)

Files changed (8)

 0a63129ab59bf013068ea9da3382e567ed5400c3 1.1
 e753d03451a6eddc1ad3876bd383a12c50aa4cf2 1.1.1
 7d389fe78ee953f32dcece8ef39b1f7136666f6a 1.1.2
+db20c81e10dc89d70fb3e6a841fd1760c350e725 1.1.3
 * Update to jQuery 1.7.1 and Underscore.js 1.3.1.
-Release 1.1.3 (in development)
+Release 1.1.4 (in development)
+Release 1.1.3 (Mar 10, 2012)
 * PR#40: Fix ``safe_repr`` function to decode bytestrings with non-ASCII
   characters correctly.

File contents unchanged.


         new_sections = []
         for section in sections:
             if not isinstance(section, unicode):
-                # XXX is this really necessary?
                 new_sections.append(force_decode(section, None))
         return True
     def write_toc(self, node, indentlevel=4):
+        # XXX this should return a Unicode string, not a bytestring
         parts = []
         if self.isdocnode(node):
             refnode = node.children[0][0]
             link = refnode['refuri']
-            title = htmlescape(refnode.astext()).replace('"','"')
-            item = '<section title="%(title)s" ref="%(ref)s">' % {
-                                                                'title': title,
-                                                                'ref': link}
+            title = htmlescape(refnode.astext()).replace('"', '&quot;')
+            item = '<section title="%(title)s" ref="%(ref)s">' % \
+                {'title': title, 'ref': link}
             parts.append(' '*4*indentlevel + item)
             for subnode in node.children[1]:
                 parts.extend(self.write_toc(subnode, indentlevel+1))


             defnode = nodes.definition()
             if definition:
-                self.state.nested_parse(definition, definition.items[0][1], defnode)
+                self.state.nested_parse(definition, definition.items[0][1],
+                                        defnode)
                           nodes.definition_list_item('', term, defnode)))


                     test = parser.get_doctest(code[0].code, {},,
                                               filename, code[0].lineno)
                 except Exception:
-                    self.warn('ignoring invalid doctest code: %r' % code[0].code,
+                    self.warn('ignoring invalid doctest code: %r' %
+                              code[0].code,
                               '%s:%s' % (filename, code[0].lineno))
                 if not test.examples:


             status_stream = sys.stdout
         confoverrides = {}
         if self.project:
-             confoverrides['project'] = self.project        
+             confoverrides['project'] = self.project
         if self.version:
              confoverrides['version'] = self.version
         if self.release:


 import sphinx
 from sphinx.errors import PycodeError
+from sphinx.util.pycompat import bytes
 # import other utilities; partly for backwards compatibility, so don't
 # prune unused ones indiscriminately
 def force_decode(string, encoding):
     """Forcibly get a unicode string out of a bytestring."""
-    if isinstance(string, str):
+    if isinstance(string, bytes):
         if encoding:
             string = string.decode(encoding)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.