bzr 1.9rc1 -> AttributeError: 'NoneType' object has no attribute 'write'

John Arbash Meinel john at arbash-meinel.com
Fri Oct 31 18:39:14 GMT 2008


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

Asmodehn Shade wrote:
> Hi all,
> 
> just found a new / different behaviour in bzr 1.9
> 
> when doing a  :
> 
>  sudo -u autobzr sh -c "cd /home/autobzr/deployBZR/branch && bzr revno"
> 
> I get :
> 
> No handlers could be found for logger "bzr"
> Traceback (most recent call last):
>   File "/usr/bin/bzr", line 129, in ?
>     bzrlib.trace.enable_default_logging()
>   File "/usr/lib/python2.4/site-packages/bzrlib/trace.py", line 253, in
> enable_default_logging
>     bzr_log_file.write(start_time.encode('utf-8') + '\n')
> AttributeError: 'NoneType' object has no attribute 'write'
> 
> this used to work on the previous version as far as I remember...
> 
> also
> 
>  sudo -u autobzr -i
> and then sh -c "cd /home/autobzr/deployBZR/branch&& bzr revno"
> 
> give the correct output : 45
> 
> I understand that "No handlers could be found for logger "bzr"" could be
> a problem, but I am pretty sure it used to return the revno anyway
> instead of
> AttributeError: 'NoneType' object has no attribute 'write'
> 
> Any idea ? I can test a bit further if needed... let me know
> 
> Cheers,
> --
> Alex

It seems that we are failing to open the log file, which is causing the
"No handlers could be found" problem.

I didn't realize that _open_bzr_log could fail and return None, so I was
unconditionally writing to the file. So a simple "if None" will probably
be sufficient to handle some of that.

I'll try to put something together, though understanding why we are
failing to open the log file might be worth investigation.

John
=:_>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkLUNIACgkQJdeBCYSNAAOGWgCfU1+humFTRKL52uN22GQQn2Cw
v4IAoKD87GAx2mFX+3a3MgTpFGSwDuSJ
=+PVg
-----END PGP SIGNATURE-----



More information about the bazaar mailing list