[PATCH] transaction: fix uncaught ENOENT (issue1724)

Adrian Buehlmann adrian at cadifra.com
Thu Jul 9 08:23:06 UTC 2009


On 07.07.2009 19:37, Henrik Stuart wrote:
> # HG changeset patch
> # User Henrik Stuart <henrik.stuart at edlund.dk>
> # Date 1246987492 -7200
> # Node ID f9ce3dd36b5d07a31c53709af9d6cbfbb75316ba
> # Parent  d4d4da54ab05c24596c3e98acbd7f052e443b2c1
> transaction: fix uncaught ENOENT (issue1724)
> 
> The opener raises an IOError on errors where transaction expects an
> OSError.
> 
> diff -r d4d4da54ab05 -r f9ce3dd36b5d mercurial/transaction.py
> --- a/mercurial/transaction.py	Tue Jul 07 01:25:44 2009 +0200
> +++ b/mercurial/transaction.py	Tue Jul 07 19:24:52 2009 +0200
> @@ -35,7 +35,7 @@
>              try:
>                  fn = opener(f).name
>                  os.unlink(fn)
> -            except OSError, inst:
> +            except IOError, inst:
>                  if inst.errno != errno.ENOENT:
>                      raise
>      os.unlink(journal)

I have applied this patch to revision 9f191931c859 (crew-stable)
and ran it by using the test case (and file) as described/provided at
issue1724 on Windows XP SP3 32bit with Python 2.5.1.

I can confirm that this patch fixes the issue.





More information about the Mercurial-devel mailing list