Uploaded image for project: 'Subversion'
  1. Subversion
  2. SVN-3688

Incorrect svn_txdelta_window_t Python binding

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • trunk
    • 1.7.0
    • bindings_swig_python
    • None

    Description

      There's a bug with Python binding for the svn_txdelta_window_t structure. The
      problem is that the 'ops' array is mapped to Python as a single object, not as
      a sequence of 'num_ops' items. That is, the following code for apply_textdelta
      does not work:
      
      def apply_textdelta(self, file_baton, base_checksum):
        self.dbg(("apply_textdelta to %s" % (file_baton[0])))
        def txdelta_handler(window):
          if window is None:
            self.dbg("txdelta - stop")
          else:
            self.dbg(("txdelta - %s [%d,%d] [X,%d] %d %d" %
                (file_baton[0], window.sview_offset, window.sview_len,
                  window.tview_len, window.src_ops, window.num_ops)))
            for o in window.ops:
              self.dbg(("  op: %d,%d,%d" % (o.action_code, o.offset, o.length)))
        return txdelta_handler
      
      It fails with the error that "for o in window.ops: TypeError: iteration over
      non-sequence". The following code works, but it can only access the first item
      in the 'ops' array:
      
      self.dbg(("  op: %d,%d,%d" %
        (window.ops.action_code, window.ops.offset, window.ops.length)))
      
      This has been confirmed to be a bug on dev@subversion.apache.org in March 2010.
      

      Original issue reported by stilor

      Attachments

        1. 1_test.sh
          5 kB
          Subversion Importer

        Activity

          People

            Unassigned Unassigned
            subversion-importer Subversion Importer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: