On 18 May 2006, Bob Tanner <[EMAIL PROTECTED]> wrote:
> Full details for the bug and proposed patch below:
> 
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=352791
> 
> Some history about why this is happening:
> 
> https://lists.ubuntu.com/archives/bazaar-ng/2006q1/008772.html

Thanks, fixed, though in a slightly different way:

> --- /tmp/builtins.py  2006-02-14 10:38:21.449525973 +0100
> +++ /usr/lib/python2.4/site-packages/bzrlib/builtins.py 2006-02-14 
> 10:41:13.509702178 +0100
> @@ -1113,12 +1113,13 @@
>              igns += '\n'
>          igns += name_pattern + '\n'
>  
> +        f = None
>          try:
>              f = AtomicFile(ifn, 'wt')
>              f.write(igns.encode('utf-8'))
>              f.commit()
>          finally:
> -            f.close()
> +            if f is not None: f.close()
>  
>          inv = tree.inventory
>          if inv.path2id('.bzrignore'):

The basic problem is that the resource guarded by try/finally is allocated
inside the try block, when it should be taken immediately before.

-- 
Martin


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to