Debian Bug report logs - #352791 (similar to last bug, r/o issue)
Martin Pool
mbp at canonical.com
Thu May 18 09:33:11 BST 2006
On 18 May 2006, Bob Tanner <tanner at real-time.com> 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
More information about the bazaar
mailing list