[Merge] lp:~jameinel/bzr/2.1.0b4-win32-fancy-rename-exception into lp:bzr

John Arbash Meinel john at arbash-meinel.com
Thu Nov 19 15:13:45 GMT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vincent Ladeuil wrote:
>>>>>> "martin" == Martin  <gzlist at googlemail.com> writes:
> 
>     martin> Review: Approve
>     martin> New test passes here. Really the create_file method is something
>     martin> that's needed on bzrlib.tests.TestCaseInTempDir as previously
>     martin> mentioned on the mailing list.
> 
> +1 on that.
> 
> Here is the version I use in a derived version of TestCaseInTempDir for
> some scripts I wrote:
> 
> 
>     def create_file(self, content, file_name=None,
>                     prefix='mytest', suffix='.tmp',
>                     cleanup=True):
>         if file_name is None:
>             fileno, file_name = tempfile.mkstemp(suffix=suffix,
>                                                  prefix=prefix)
>             f = os.fdopen(fileno, 'w+')

^- This is generally much clearer as:

f = tempfile.TemporaryFile(suffix=suffix, prefix=prefix)

At least, IMO.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksFYKkACgkQJdeBCYSNAAPzzwCglq4kUtoDT37MhyNd3k4v5n++
/bAAoJSlil8DAt1rI9Rw/nciOwnzDpVZ
=JRuN
-----END PGP SIGNATURE-----



More information about the bazaar mailing list