From dev-return-2458-daniel=haxx.se@subversion.apache.org Mon Mar 8 18:30:16 2010 Return-Path: Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by giant.haxx.se (8.14.3/8.14.3/Debian-9) with SMTP id o28HUFhr025413 for ; Mon, 8 Mar 2010 18:30:16 +0100 Received: (qmail 99355 invoked by uid 500); 8 Mar 2010 17:30:11 -0000 Mailing-List: contact dev-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@subversion.apache.org Received: (qmail 99347 invoked by uid 99); 8 Mar 2010 17:30:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Mar 2010 17:30:11 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_HELO_PASS,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [216.100.252.22] (HELO asmtp.lnxw.com) (216.100.252.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Mar 2010 17:30:06 +0000 Received: from boba.lynx.com (BOBA.Lynx.COM [172.17.130.85]) by asmtp.lnxw.com (8.13.8/8.13.8) with ESMTP id o28HJxrM005674 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 8 Mar 2010 09:20:02 -0800 From: Alexey Neyman To: dev@subversion.apache.org Subject: Re: Bug with svn_txdelta_window_t Python binding? Date: Mon, 8 Mar 2010 09:29:41 -0800 User-Agent: KMail/1.9.9 References: <201003041340.56540.stilor@att.net> In-Reply-To: <201003041340.56540.stilor@att.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201003080929.42024.stilor@att.net> Any experts on Python bindings on this list? :) Could this at least be confirmed to be a bug, so that I could enter it into issues database? Regards, Alexey On Thursday 04 March 2010 01:40:56 pm Alexey Neyman wrote: > Hi all, > > It looks like 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))) > > I am not a SWIG expert; could someone confirm if it's a bug in SWIG > Python bindings? > > Regards, > Alexey.