[BUG] bzr.dev fails when 'rollover_trace_maybe'

Alexander Belchenko bialix at ukr.net
Sat Sep 22 23:42:45 BST 2007


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

Alexander Belchenko пишет:
> John Arbash Meinel ?8H5B:
>> 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.

I just looking at old version, and see the line missed:

        from osutils import rename
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD4DBQFG9ZplzYr338mxwCURAsHDAJjAk+CwfQ3f3p2JA5GP4kRJ/gPwAJ4rtkLH
Ty87d6PY8OKPCy0eAqrP6g==
=rmw/
-----END PGP SIGNATURE-----



More information about the bazaar mailing list