[BUG] bzr.dev fails when 'rollover_trace_maybe'

Alexander Belchenko bialix at ukr.net
Sat Sep 22 23:38:09 BST 2007


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

John Arbash Meinel пишет:
> I just got this error:
> % bzr --no-plugins st
>     Traceback (most recent call last):
>   File "/home/jameinel/bin/bzr", line 98, in <module>
>     bzrlib.trace.enable_default_logging()
>   File "/home/jameinel/dev/bzr/bzr.dev/bzrlib/trace.py", line 218, in
> enable_default_logging
>     open_tracefile()
>   File "/home/jameinel/dev/bzr/bzr.dev/bzrlib/trace.py", line 177, in
> open_tracefile
>     _rollover_trace_maybe(_bzr_log_filename)
>   File "/home/jameinel/dev/bzr/bzr.dev/bzrlib/trace.py", line 154, in
> _rollover_trace_maybe
>     rename(trace_fname, old_fname)
> NameError: global name 'rename' is not defined
> 
> I think one of the recent changes removed 'rename' from the local
> namespace, so now it is failing to backup the old .bzr.log to .bzr.log.old.
> 
> I don't know what patch caused it, but this "fixes" it:
> === modified file 'bzrlib/trace.py'
> --- bzrlib/trace.py     2007-09-21 06:13:09 +0000
> +++ bzrlib/trace.py     2007-09-22 22:07:51 +0000
> @@ -151,7 +151,7 @@
>          if size <= 4 << 20:
>              return
>          old_fname = trace_fname + '.old'
> -        rename(trace_fname, old_fname)
> +        os.rename(trace_fname, old_fname)
>      except OSError:
>          return

Please, don't use os module directly.
I'm sure here should be osutils.rename, otherwise it fails on win32.

- --
[µ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG9ZlQzYr338mxwCURAtR6AKCEt3Q7ljjX24sEZWOZMbXkM1nkvgCeNNtM
whKjGhgse3xedkeX2y21Bwg=
=q5Hf
-----END PGP SIGNATURE-----



More information about the bazaar mailing list