[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: svn commit: r931162 - in /subversion/trunk: ./ subversion/libsvn_diff/parse-diff.c subversion/tests/cmdline/patch_tests.py

From: Bert Huijben <bert_at_qqmail.nl>
Date: Thu, 8 Apr 2010 10:32:51 +0200

> -----Original Message-----
> From: stsp_at_apache.org [mailto:stsp_at_apache.org]
> Sent: dinsdag 6 april 2010 16:20
> To: commits_at_subversion.apache.org
> Subject: svn commit: r931162 - in /subversion/trunk: ./
> subversion/libsvn_diff/parse-diff.c subversion/tests/cmdline/patch_tests.py
>
> Author: stsp
> Date: Tue Apr 6 14:20:21 2010
> New Revision: 931162
>
> URL: http://svn.apache.org/viewvc?rev=931162&view=rev
> Log:
> Cherry-pick r929288 and r931140 from the svn-patch-improvements branch
> to trunk, fixing the problem reported in:
>
> Date: Wed, 3 Mar 2010 15:52:59 +0100
> From: Stefan Sperling
> To: dev_at_subversion.apache.org
> Subject: svn patch fails on this diff
> Message-ID: <20100303145259.GF8176_at_noel.stsp.name>
> http://svn.haxx.se/dev/archive-2010-03/0097.shtml
> http://svn.haxx.se/dev/archive-2010-03/0098.shtml (attachment)
>

 
> Modified: subversion/trunk/subversion/tests/cmdline/patch_tests.py
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/
> patch_tests.py?rev=931162&r1=931161&r2=931162&view=diff
> ==========================================================
> ====================
> --- subversion/trunk/subversion/tests/cmdline/patch_tests.py (original)
> +++ subversion/trunk/subversion/tests/cmdline/patch_tests.py Tue Apr 6
> 14:20:21 2010
> @@ -841,6 +841,92 @@ def patch_strip1(sbox):
> 1, # dry-run
> '-p1')
>
> +def patch_no_index_line(sbox):
> + "patch with no index lines"
> +
> + sbox.build()
> + wc_dir = sbox.wc_dir
> +
> + patch_file_path =
> tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))[1]

This line reintroduces the issue I fixed in the other tests in r930990.

Stefan: Answering your question: It seems the handle must be closed before leaving the function. (I don't mind where, as long as it fixes the errors)

Greg: You just fixed several other functions to use open(...).read(), without closing the handle. This doesn't cause the same error, so this file is somehow closed without the explicit close required above. Do you have any idea why mkstemp() does need the explicit close? (Python bug?)

Other question: Do we really need a mkstemp call here? I assumed we have a per test temporary directory where we can place any named file we want?

        Bert
Received on 2010-04-08 10:33:27 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.